Restrict a library from going into final image

Viewed 54

I am building a Yocto image. There are some GPLv3 libraries which are required only at build time. I have put GPLv3 as INCOMPATIBLE_LICENSE and whitelisted the libraries which are required at build time. But these libraries are getting into the final image. How can I restrict them into the final image and only use them at the build time?

1 Answers

If we think about the Yocto basics, we know that everything goes into the final image is a collection of recipes providing packages that are collected together in a single root file system.

So, what makes a recipe goes into the final rootfs ?

  • Added via IMAGE_INSTALL.
  • Be set as RDEPENDS of another recipe.

You need to analyse that deeply to find out what goes into your final rootfs.

Also, you may not find it obvious in the content of IMAGE_INSTALL by running:

bitbake -e <your_image_recipe> | grep ^IMAGE_INSTALL= 

but, you may see some packagegroups that are shipped. A packagegroup is a group that RDEPENDS on a list of other recipes.

So, you need to carefully analyse them (if found) to see what provides the lib you want to inhibit from rootfs.

packagegroups usually gets shipped dynamically via IMAGE_FEATURES variable.

So, those are the most important points that are responsible of shipping a recipe to the rootfs. So, Analyse your wanted recipe.

  • Is it an RDEPENDS of another recipe ?
  • Find out where exactly it gets called to be shipped.
Related