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

Bruce Ashfield bruce.ashfield at gmail.com
Mon Oct 2 10:12:54 PDT 2017


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
>
> --
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


More information about the meta-virtualization mailing list