yoctobitbakeyocto-recipeyocto-layer

Restrict a library from going into final image


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?


Solution

  • PACKAGE_EXCLUDE worked for me. If packages listed under PACKAGE_EXCLUDE is getting into the final image, then this will raise an error. Also if any other package has a runtime dependency on a package listed under PACKAGE_EXCLUDE, then this will raise an error too.

    References: https://docs.yoctoproject.org/ref-manual/variables.html#term-PACKAGE_EXCLUDE https://git.yoctoproject.org/poky/tree/meta/conf/documentation.conf#n313