Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yocto rebuild image after modifying source code

How can I rebuild the image after making some modifications to driver source code?

I have tried bitbake -f -c compile and bitbake but I coudn't find the modified settings in the driver. Can someone tell me how can i rebuild the image with the modified code.

like image 988
maddog Avatar asked Aug 30 '26 21:08

maddog


2 Answers

I guess that you want to re-generate the whole image, don't you? If so, you can try the following commands to ensure that bitbake won't use the sstate cache:

bitbake image-name -c cleansstate && bitbake image-name

In the case you just want to rebuild the kernel, substitute image-name by virtual/kernel (or the name of whatever recipe you want to rebuild).

Note that the do_cleansstate task is going to remove the recipe ${WORKDIR}!

For further information: https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#ref-tasks-cleansstate

In the case you're doing such modifications directly in the ${WORKDIR}, which you shouldn't unless you're testing, the execution of the following command would be enough:

bitbake virtual/kernel -f -c compile

or

bitbake virtual/kernel -C compile (to invalidate the stamps and force all tasks starting from do_compile)
like image 134
danrodlor Avatar answered Sep 04 '26 15:09

danrodlor


Since changes in ${WORKDIR} will be rewritten after cleaning, you can put your code to external workspace by command devtool modify <recipe-name>

By default your recipe code will be put into tmp/workspace/source/ directory Now you can freely modify your code and simply build using bitbake <recipe-name> as usual.

When your modification are OK you can easily save your changes as patches to original recipe code (as far as it is likely open-source and downloaded):

  • commit your changes in your workspace
  • in order to automatically create patches and append they to recipe use command devtool recipe-update -a <layer-path> <recipe-name>
like image 36
Ilya Kondrashkin Avatar answered Sep 04 '26 13:09

Ilya Kondrashkin