[OE-core] [RFC PATCH 1/1] classes/whitelist: add class to allow whitelisting recipes from a layer
Huang, Jie (Jackie)
Jackie.Huang at windriver.com
Fri Aug 21 07:30:19 UTC 2015
> -----Original Message-----
> From: openembedded-core-bounces at lists.openembedded.org [mailto:openembedded-core-
> bounces at lists.openembedded.org] On Behalf Of Patrick Ohly
> Sent: Thursday, August 20, 2015 9:47 PM
> To: Paul Eggleton
> Cc: openembedded-core at lists.openembedded.org
> Subject: Re: [OE-core] [RFC PATCH 1/1] classes/whitelist: add class to allow whitelisting recipes from a
> layer
>
> 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):
This worked for my tests as well, there are 160 recipes in my whitelist and there are 3 different cases:
1) All recipes are needed: nothing need to be done here.
2) No recipe is needed:
PNWHITELIST_efl-layer = "Nothing"
PNWHITELIST_filesystems-layer = "Nothing"
PNWHITELIST_gpe-layer = "Nothing"
PNWHITELIST_meta-initramfs = "Nothing"
PNWHITELIST_multimedia-layer = "Nothing"
PNWHITELIST_ruby-layer = "Nothing"
PNWHITELIST_systemd-layer = "Nothing"
PNWHITELIST_toolchain-layer = "Nothing"
3) Some of the recipes are whitelisted, take gnome-layer for example:
PNWHITELIST_gnome-layer = "\
gnome-disk-utility \
gnome-keyring \
gsettings-desktop-schemas \
gvfs \
gvfs-gdu-volume-monitor \
libgnome-keyring \
libgtop \
libwnck \
libwnck3 \
libxklavier \
metacity \
"
I also test to put some recipes both in whitelist and blacklist, and it turned out that
the blacklist's priority is higher than whitelist.
>
> 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.
I vote for this suggestion, it's better than a fake recipe name.
Thanks,
Jackie
>
> --
> 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.
>
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
More information about the Openembedded-core
mailing list