Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbake -c clean removed source

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.

like image 892
Gomu Avatar asked May 10 '16 07:05

Gomu


People also ask

What is BitBake recipe?

BitBake recipes specify how a particular package is built. Recipes consist of the source URL (http, https, ftp, cvs, svn, git, local file system) of the package, dependencies and compile or install options. They also store the metadata for the package in standard variables.

What does BitBake clean do?

This command will clean up your tmp dir for the given package. It is very useful if you work on a new . bb recipe. Without it your changes to the recipe may not work.

What is Src_uri?

SRC_URI = file:// Fetches files, which are usually files shipped with the Metadata, from the local machine. The path is relative to the FILESPATH variable. Thus, the build system searches, in order, from the following directories, which are assumed to be a subdirectories of the directory in which the recipe file (.

What is Workdir in yocto?

WORKDIR. The pathname of the work directory in which the OpenEmbedded build system builds a recipe. This directory is located within the TMPDIR directory structure and is specific to the recipe being built and the system for which it is being built.


2 Answers

bitbake -c cleansstate <package name>

will not remove the source, so do_fetch content will be as it is. And next time

bitbake <package name>

So, do_fetch will not execute next time but rest of the. Such as do_patch, do_metadata, do_compile, etc. If you want to try with some changes at the source level, you can also have a try of

bitbake <package name> -c devshell

I found devshell a convenient way to try with some source or inpackage level changes and tryout. It does open a new shell at the package location. Where you can give the commands locally. As simple as make.

like image 179
Abhishek Dwivedi Avatar answered Jan 01 '23 21:01

Abhishek Dwivedi


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.

like image 29
Jussi Kukkonen Avatar answered Jan 01 '23 23:01

Jussi Kukkonen