(17): Yocto License问题:restricted license not whitelisted in LICENSE_FLAGS_WHITELIST

最后更新于:2022-04-01 16:21:08

Yocto中可以配置一个Distrbution的License,然后所有的软件包,都需要符合这个license才可以被shipped到image中,如果我们需要使用违反此license的软件包,那么就需要额外配置。 例如,在bitbake编译vlc的时候出现下面的错误log: ~~~ $ bitbake vlc Parsing recipes: 100% |###################################################################################################################################| Time: 00:00:26 Parsing of 2029 .bb files complete (0 cached, 2029 parsed). 2524 targets, 210 skipped, 1 masked, 0 errors. NOTE: Resolving any missing task queue dependencies ERROR: Nothing PROVIDES 'ffmpeg' (but /media/work/iMX6/Yocto/sources/meta-openembedded/meta-multimedia/recipes-multimedia/vlc/vlc_2.1.4.bb DEPENDS on or otherwise requires it) ERROR: libav PROVIDES ffmpeg but was skipped: because it has a restricted license not whitelisted in LICENSE_FLAGS_WHITELIST ERROR: libav PROVIDES ffmpeg but was skipped: because it has a restricted license not whitelisted in LICENSE_FLAGS_WHITELIST ERROR: Required build target 'vlc' has no buildable providers. Missing or unbuildable dependency chain was: ['vlc', 'ffmpeg'] ~~~ 那么就是因为vlc依赖libav,但是libav,的license不符合Distribution的License而无法编译。在libav中的bb文件配置中,可以看到其license flag为commercial: ![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a39667a.jpg) ## 开启接受所有的commercial license软件包 因此如果我们需要添加一些commercial Lincense的软件包,就需要添加对commercial的支持,只需要在local.conf中添加一行即可: ~~~ LICENSE_FLAGS_WHITELIST="commercial" ~~~ ## 只接受特定的commercial license软件包 但是如果我们只期望某些特殊的commercial软件包可以被编译放入到rootfs中,那么我们就需要逐个指定,例如指定libav等包可以被编译: ![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a3b4b30.jpg)
';