On Thu, Oct 5, 2017 at 12:15 PM, Paul Barker <pbar...@toganlabs.com> wrote: > On Mon, Oct 2, 2017 at 6:12 PM, Bruce Ashfield <bruce.ashfi...@gmail.com> > wrote: >> v4 is merged. >> >> Bruce >> >> On Fri, Sep 29, 2017 at 11:06 PM, Chen Qi <qi.c...@windriver.com> wrote: >>> Add a new class, sanity-meta-virt.bbclass, to check for whether necessary >>> settings are available for bbappend files in this layer to be effective, >>> and warn users if not. >>> >>> In addition, a variable SKIP_SANITY_BBAPPEND_CHECK is added to enable users >>> to explicitly skip the checking to avoid unwanted warnings. >>> >>> Signed-off-by: Chen Qi <qi.c...@windriver.com> >>> --- >>> classes/sanity-meta-virt.bbclass | 10 ++++++++++ >>> conf/layer.conf | 4 ++++ >>> 2 files changed, 14 insertions(+) >>> create mode 100644 classes/sanity-meta-virt.bbclass >>> >>> diff --git a/classes/sanity-meta-virt.bbclass >>> b/classes/sanity-meta-virt.bbclass >>> new file mode 100644 >>> index 0000000..bd2b717 >>> --- /dev/null >>> +++ b/classes/sanity-meta-virt.bbclass >>> @@ -0,0 +1,10 @@ >>> +addhandler virt_bbappend_distrocheck >>> +virt_bbappend_distrocheck[eventmask] = "bb.event.ConfigParsed" >>> +python virt_bbappend_distrocheck() { >>> + skip_check = e.data.getVar('SKIP_SANITY_BBAPPEND_CHECK') == "1" >>> + if 'virtualization' not in e.data.getVar('DISTRO_FEATURES').split() >>> and not skip_check: >>> + bb.warn("You have included the meta-virtualization layer, but \ >>> +'virtualization' has not been enabled in your DISTRO_FEATURES. Some >>> bbappend files \ >>> +may not take effect. See the meta-virtualization README for details on >>> enabling \ >>> +virtualization support.") >>> +} >>> diff --git a/conf/layer.conf b/conf/layer.conf >>> index be08a98..51ca8ee 100644 >>> --- a/conf/layer.conf >>> +++ b/conf/layer.conf >>> @@ -22,3 +22,7 @@ require conf/distro/include/virt_security_flags.inc >>> >>> PREFERRED_PROVIDER_virtual/runc ?= "runc-docker" >>> PREFERRED_PROVIDER_virtual/containerd ?= "containerd-docker" >>> + >>> +# Sanity check for meta-virtualization layer. >>> +# Setting SKIP_SANITY_BBAPPEND_CHECK to "1" would skip the bbappend files >>> check. >>> +INHERIT += "sanity-meta-virt" >>> -- >>> 2.11.0 >>> > > I'm getting this new warning up to 4 times on each bitbake invocation: > twice before the "Parsing recipes" line, once after the "Executing > SetScene Tasks" line (if present) and once after the "Executing > RunQueue Tasks" line. > > It's also totally irrelevant for users of a distro like ours (Oryx > Linux) which includes meta-virtualization for runc, docker or other > related tools but doesn't use kvm or xen. > > I guess I can set SKIP_SANITY_BBAPPEND_CHECK in our distro config but > this sounds like a universal skip for all sanity bbappend checks - is > this intended? Or does this variable just apply to the check in this > layer? If it's specific to this layer I think it needs a better name.
Fire off a patch to make the name more specific and I'll merge it right away. I'm actively testing some other things, and have the distro flags set, so I'd like a patch from someone that was seeing the warning, and can confirm that we can actually disable it. Cheers, Bruce > > Thanks, > > -- > Paul Barker > Togán Labs Ltd -- "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" -- _______________________________________________ meta-virtualization mailing list meta-virtualization@yoctoproject.org https://lists.yoctoproject.org/listinfo/meta-virtualization