Search code examples
yoctobitbakerecipe

Build Yocto sources


I need the source packages for a Yocto project. I have already all the sources for the whole project, but they also include the development tools.

I would like to have a way of generating the (patched) sources of all the packages which will be built for the target image. So, for example, if the target image contains busybox, I'd like to have a copy of the busybox source package with the patches applied. I don't need the compiled package.

Is it possible to do this easily?

I couldn't find a hint in the bitbake manual and there's no API (at least I couldn't find one) to work with recipes.


Solution

  • The 'archiver` class is what you're looking for.

    If you want the patched sources, you likely want something close to this in local.conf:

    INHERIT += "archiver"
    COPYLEFT_RECIPE_TYPES = 'target'
    

    Yocto Project documentation on maintaining open source compliance. The archiver.bbclass file itself has docs on how to use it. (i.e. dumping configured sources, creating srpm's, dumping the source code for more than the target, etc).