11 September 2015

Compiling a device tree using yocto


I am assuming you have a functional kernel recipe, say 'linux-yocto' with a device tree in e.g. arch/arm/boot/dts.

First build your kernel using

bitbake linux-yocto

Then run again using devshell

bitbake linux-yocto -c devshell

This places you in an shell in the temporary kernel source directory:

tmp/work-shared/machine/kernel-source 

However all of the yocto scripts required to build are in the build output directory, $KBUILD_OUTPUT. That will be something like:

tmp/work/machine-poky-linux-gnueabi/linux-mainline/4.2+gitAUTOINC+2bb14348ec-r1/linux-yocto-standard-build

so to edit-build-deploy a device tree, you need to edit the dts file in the build directory (I find I need to do this from a different window, as editors don't work right in the devshell)

emacs arch/arm/boot/dts/machine.dts

then (still from the source directory)

make machine.dtb

(Note: machine.dtb, not machine.dts.)

Then copy your dtb file from the build output directory:

cp $KBUILD_OUTPUT/arch/arm/boot/dts/machine.dtb ~

Do not forget to copy your updated dts someplace permanent, because the kernel-source work dir will get wiped out in the next do_fetch() operation.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.