I'm beginner for 'BitBake'. I need to modify source code and build it. I found the sources to be located at build/tmp/work/ within a directory which has git commit id as its name. I wanted to rebuild the source. So I gave bitbake -c clean <package_name>
, followed by bitbake <package_name>
. The image got built. But, when I went back to modify the source, the git repository seems to be missing in its location.
1) How do I get the source back?
2) What is the safe way of rebuilding the source after making modifications?
Thanks in advance.
1) How do I get the source back?
bitbake -ccleansstate <package_name>
bitbake <package_name>
This will make sure bitbake won't use shared state and will have to actually do all the tasks during the second command (including unpack and patch, which will populate sources in a directory in $WORKDIR).
2) What is the safe way of rebuilding the source after making modifications?
If you want to modify sources in $WORKDIR as a quick hack, then
bitbake -f -ccompile <package_name>
bitbake <package_name>
will mark the compile task as dirty and when the next command builds the recipe, all tasks from compile onwards will be executed. Note that bitbake will warn you about the dirty state until you do a cleansstate
, and also that cleansstate
will wipe the $WORKDIR alongside your changes: so this is only useful for quick tests.
If you're looking for a way to do more development and still quickly test things with a yocto/OE build alongside the development, take a look at devtool. I expect part 4.3.1.2. (Use devtool modify to Enable Work on Code Associated with an Existing Recipe) might be relevant for you.