Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quick rebuild of device tree only with Yocto/bitbake?

Tags:

So, each time I modify the device tree I typically change the dts in a custom recipe and rebuild the image. The rebuild takes a long time since it rebuilds the entire kernel, and then the image needs to be built and finally deployed to the target device.

Is there any trick that I'm missing that rebuilds only the device tree?

UPDATE:

I've marked g0hl1n's answer as the correct one, since it is the answer to my question. However, I found it to be very cumbersome to work with the kernel in Yocto: strange, long paths and risk of files being overwritten on each rebuild, source of kernel in tmp/work-shared while the kernel is being built in tmp/work.

Instead I've moved the kernel development out of Yocto. Yocto has good tools for creating an SDK (see populate_sdk task) and with that it's easy to setup an environment for kernel development with quick rebuilds and manual (or scripted) deployments. Once the work is done the changes can be moved to a recipe using git diff.

The instructions on the following page was very helpful: http://jumpnowtek.com/beaglebone/Working-on-the-BeagleBone-kernel.html

like image 767
Jonatan Avatar asked Aug 12 '16 12:08

Jonatan


People also ask

What is Bitbake in yocto?

Bitbake is a task scheduler that parses Python and Shell script mixed code, which we called Recipes. The code parsed generates and runs tasks. They are a set of steps orders according to the code's dependencies. Metadata is where all the Recipes are located.


1 Answers

AFAIK there are two different ways of doing this.

  1. The kernel way: Using the scripts provided by the kernel
  • Change to your kernel source directory (<build dir>/tmp/work/<machine>/<kernel-name>/<kernel-version>/git/)
  • Execute the device-tree-compiler: ./scripts/dtc/dtc -I dts -O dtb -o ./devicetree.dtb path/to/devicetree.dts
  1. The bitbake way: Using the kernel's deploy job
  • Call $ bitbake <kernel-name> -f -c deploy
  • The generated device-tree-blob then can be found in <build dir>/tmp/work/<machine>/<kernel-name>/<kernel-version>/build/arch/arm/boot/dts/)

At least for me both versions worked in a quick test.

UPDATE: I just came over a third version of building the dtb with yocto on the net. That one uses yocto's devshell of the kernel build. For more information see the original authors page at https://splefty.blogspot.co.at/2015/09/compiling-device-tree-using-yocto.html.

like image 62
g0hl1n Avatar answered Sep 28 '22 17:09

g0hl1n