[OE-core] [RFC PATCH 1/1] classes/whitelist: add class to allow whitelisting recipes from a layer

Patrick Ohly patrick.ohly at intel.com
Thu Aug 20 13:47:22 UTC 2015


On Wed, 2015-08-19 at 14:34 +0100, Paul Eggleton wrote:
> Allow restricting recipes brought from a layer to a specified list. This
> is similar in operation to blacklist.bbclass, but instead specifies a
> per-layer whitelist of recipes (matched by BPN) that are able to be
> built from the layer - anything else is skipped. This is potentially
> useful where you want to bring in a select set of recipes from a larger
> layer e.g. meta-oe.

Worked for all of my tests. I added all layers in meta-openembedded and
then white-listed just gmock in meta-oe (aka openembedded-layer):

INHERIT += "whitelist"

PNWHITELIST_efl-layer = "no-recipe-enabled"
PNWHITELIST_filesystems-layer = "no-recipe-enabled"
PNWHITELIST_gnome-layer = "no-recipe-enabled"
PNWHITELIST_gpe-layer = "no-recipe-enabled"
PNWHITELIST_meta-initramfs = "no-recipe-enabled"
PNWHITELIST_meta-python = "no-recipe-enabled"
PNWHITELIST_multimedia-layer = "no-recipe-enabled"
PNWHITELIST_networking-layer = "no-recipe-enabled"
PNWHITELIST_openembedded-layer = "gmock"
PNWHITELIST_perl-layer = "no-recipe-enabled"
PNWHITELIST_ruby-layer = "no-recipe-enabled"
PNWHITELIST_systemd-layer = "no-recipe-enabled"
PNWHITELIST_toolchain-layer = "no-recipe-enabled"
PNWHITELIST_webserver = "no-recipe-enabled"
PNWHITELIST_xfce-layer = "no-recipe-enabled"

I got warnings for several of the layers, but strangely not for all of
them:

WARNING: No bb files matched BBFILE_PATTERN_efl-layer '^/work/meta-openembedded/meta-efl/'
WARNING: No bb files matched BBFILE_PATTERN_filesystems-layer '^/work/meta-openembedded/meta-filesystems/'
WARNING: No bb files matched BBFILE_PATTERN_gpe-layer '^/work/meta-openembedded/meta-gpe/'
WARNING: No bb files matched BBFILE_PATTERN_meta-initramfs '^/work/meta-openembedded/meta-initramfs/'
WARNING: No bb files matched BBFILE_PATTERN_multimedia-layer '^/work/meta-openembedded/meta-multimedia/'
WARNING: No bb files matched BBFILE_PATTERN_networking-layer '^/work/meta-openembedded/meta-networking/'
WARNING: No bb files matched BBFILE_PATTERN_perl-layer '^/work/meta-openembedded/meta-perl/'
WARNING: No bb files matched BBFILE_PATTERN_meta-python '^/work/meta-openembedded/meta-python/'
WARNING: No bb files matched BBFILE_PATTERN_ruby-layer '^/work/meta-openembedded/meta-ruby/'
WARNING: No bb files matched BBFILE_PATTERN_webserver '^/work/meta-openembedded/meta-webserver/'
WARNING: No bb files matched BBFILE_PATTERN_xfce-layer '^/work/meta-openembedded/meta-xfce/'

Note that gnome-layer is not warned about, although none of its recipes
are enabled (checked with "bitbake-layers show-recipes -f | grep -v
'(skipped)' | grep meta-gnome"). Any idea why?

One more comment: it would be slightly nicer if empty whitelist could be
distinguished from no whitelist, with "empty" meaning "enable no
recipes". In other words, replace "if whitelist" with "if whitelist is
not None".

I want to list all PNWHITELIST_xxx values for meta-openembedded, even
when the layer is not (yet) in bblayers.sample.conf, in order to be
prepared for adding it later. Doing that with an empty string is more
readable than with a fake recipe name to make the variable non-empty.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.






More information about the Openembedded-core mailing list