[meta-virtualization] [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking

Paul Barker pbarker at toganlabs.com
Thu Oct 5 09:15:46 PDT 2017


On Mon, Oct 2, 2017 at 6:12 PM, Bruce Ashfield <bruce.ashfield at gmail.com> wrote:
> v4 is merged.
>
> Bruce
>
> On Fri, Sep 29, 2017 at 11:06 PM, Chen Qi <Qi.Chen at 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.Chen at 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.

Thanks,

-- 
Paul Barker
Togán Labs Ltd


More information about the meta-virtualization mailing list