All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking
@ 2017-09-30  3:06 Chen Qi
  2017-09-30  3:06 ` [PATCH V4 2/3] linux-yocto: make bbappend have effect conditionally Chen Qi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Chen Qi @ 2017-09-30  3:06 UTC (permalink / raw)
  To: meta-virtualization

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@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



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V4 2/3] linux-yocto: make bbappend have effect conditionally
  2017-09-30  3:06 [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking Chen Qi
@ 2017-09-30  3:06 ` Chen Qi
  2017-09-30  3:06 ` [PATCH V4 3/3] README: update to include information about bbappend inclusion Chen Qi
  2017-10-02 17:12 ` [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking Bruce Ashfield
  2 siblings, 0 replies; 8+ messages in thread
From: Chen Qi @ 2017-09-30  3:06 UTC (permalink / raw)
  To: meta-virtualization

Make these bbappend files to take effect only when DISTRO_FEATURES
contain 'virtualization'. Otherwise, we would meet failure failure
at system booting up qemux86. Related logs are as below.

 systemd-modules-load[113]: Failed to insert 'kvm_amd': Operation not supported
 systemd-modules-load[113]: Failed to insert 'kvm_intel': Operation not supported

Also, make kvm related settings depend on the 'kvm' distro feature.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 recipes-kernel/linux/linux-yocto_4.10.bbappend      | 21 +--------------------
 recipes-kernel/linux/linux-yocto_4.12.bbappend      | 21 +--------------------
 recipes-kernel/linux/linux-yocto_4.4.bbappend       | 21 +--------------------
 recipes-kernel/linux/linux-yocto_4.9.bbappend       | 21 +--------------------
 recipes-kernel/linux/linux-yocto_virtualization.inc | 20 ++++++++++++++++++++
 5 files changed, 24 insertions(+), 80 deletions(-)
 create mode 100644 recipes-kernel/linux/linux-yocto_virtualization.inc

diff --git a/recipes-kernel/linux/linux-yocto_4.10.bbappend b/recipes-kernel/linux/linux-yocto_4.10.bbappend
index f163fdf..617cacc 100644
--- a/recipes-kernel/linux/linux-yocto_4.10.bbappend
+++ b/recipes-kernel/linux/linux-yocto_4.10.bbappend
@@ -1,20 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://xt-checksum.scc \
-            file://ebtables.scc \
-	    file://vswitch.scc \
-	    file://lxc.scc \
-            file://docker.scc \
-	    "
-KERNEL_FEATURES_append = " features/kvm/qemu-kvm-enable.scc"
-
-KERNEL_MODULE_AUTOLOAD += "openvswitch"
-KERNEL_MODULE_AUTOLOAD += "kvm"
-KERNEL_MODULE_AUTOLOAD += "kvm-amd"
-KERNEL_MODULE_AUTOLOAD += "kvm-intel"
-
-# aufs kernel support required for xen-image-minimal
-KERNEL_FEATURES_append += "${@bb.utils.contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}"
-
-# xen kernel support
-SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
+require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${BPN}_virtualization.inc', '', d)}
diff --git a/recipes-kernel/linux/linux-yocto_4.12.bbappend b/recipes-kernel/linux/linux-yocto_4.12.bbappend
index f163fdf..617cacc 100644
--- a/recipes-kernel/linux/linux-yocto_4.12.bbappend
+++ b/recipes-kernel/linux/linux-yocto_4.12.bbappend
@@ -1,20 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://xt-checksum.scc \
-            file://ebtables.scc \
-	    file://vswitch.scc \
-	    file://lxc.scc \
-            file://docker.scc \
-	    "
-KERNEL_FEATURES_append = " features/kvm/qemu-kvm-enable.scc"
-
-KERNEL_MODULE_AUTOLOAD += "openvswitch"
-KERNEL_MODULE_AUTOLOAD += "kvm"
-KERNEL_MODULE_AUTOLOAD += "kvm-amd"
-KERNEL_MODULE_AUTOLOAD += "kvm-intel"
-
-# aufs kernel support required for xen-image-minimal
-KERNEL_FEATURES_append += "${@bb.utils.contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}"
-
-# xen kernel support
-SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
+require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${BPN}_virtualization.inc', '', d)}
diff --git a/recipes-kernel/linux/linux-yocto_4.4.bbappend b/recipes-kernel/linux/linux-yocto_4.4.bbappend
index f163fdf..617cacc 100644
--- a/recipes-kernel/linux/linux-yocto_4.4.bbappend
+++ b/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -1,20 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://xt-checksum.scc \
-            file://ebtables.scc \
-	    file://vswitch.scc \
-	    file://lxc.scc \
-            file://docker.scc \
-	    "
-KERNEL_FEATURES_append = " features/kvm/qemu-kvm-enable.scc"
-
-KERNEL_MODULE_AUTOLOAD += "openvswitch"
-KERNEL_MODULE_AUTOLOAD += "kvm"
-KERNEL_MODULE_AUTOLOAD += "kvm-amd"
-KERNEL_MODULE_AUTOLOAD += "kvm-intel"
-
-# aufs kernel support required for xen-image-minimal
-KERNEL_FEATURES_append += "${@bb.utils.contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}"
-
-# xen kernel support
-SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
+require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${BPN}_virtualization.inc', '', d)}
diff --git a/recipes-kernel/linux/linux-yocto_4.9.bbappend b/recipes-kernel/linux/linux-yocto_4.9.bbappend
index f163fdf..617cacc 100644
--- a/recipes-kernel/linux/linux-yocto_4.9.bbappend
+++ b/recipes-kernel/linux/linux-yocto_4.9.bbappend
@@ -1,20 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://xt-checksum.scc \
-            file://ebtables.scc \
-	    file://vswitch.scc \
-	    file://lxc.scc \
-            file://docker.scc \
-	    "
-KERNEL_FEATURES_append = " features/kvm/qemu-kvm-enable.scc"
-
-KERNEL_MODULE_AUTOLOAD += "openvswitch"
-KERNEL_MODULE_AUTOLOAD += "kvm"
-KERNEL_MODULE_AUTOLOAD += "kvm-amd"
-KERNEL_MODULE_AUTOLOAD += "kvm-intel"
-
-# aufs kernel support required for xen-image-minimal
-KERNEL_FEATURES_append += "${@bb.utils.contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}"
-
-# xen kernel support
-SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
+require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${BPN}_virtualization.inc', '', d)}
diff --git a/recipes-kernel/linux/linux-yocto_virtualization.inc b/recipes-kernel/linux/linux-yocto_virtualization.inc
new file mode 100644
index 0000000..9905ed9
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto_virtualization.inc
@@ -0,0 +1,20 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:"
+
+SRC_URI += "file://xt-checksum.scc \
+            file://ebtables.scc \
+	    file://vswitch.scc \
+	    file://lxc.scc \
+            file://docker.scc \
+	    "
+KERNEL_FEATURES_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'kvm', 'features/kvm/qemu-kvm-enable.scc', '', d)}"
+
+KERNEL_MODULE_AUTOLOAD += "openvswitch"
+KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES', 'kvm', 'kvm', '', d)}"
+KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES', 'kvm', 'kvm-amd', '', d)}"
+KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES', 'kvm', 'kvm-intel', '', d)}"
+
+# aufs kernel support required for xen-image-minimal
+KERNEL_FEATURES_append += "${@bb.utils.contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}"
+
+# xen kernel support
+SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V4 3/3] README: update to include information about bbappend inclusion
  2017-09-30  3:06 [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking Chen Qi
  2017-09-30  3:06 ` [PATCH V4 2/3] linux-yocto: make bbappend have effect conditionally Chen Qi
@ 2017-09-30  3:06 ` Chen Qi
  2017-10-02 17:12 ` [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking Bruce Ashfield
  2 siblings, 0 replies; 8+ messages in thread
From: Chen Qi @ 2017-09-30  3:06 UTC (permalink / raw)
  To: meta-virtualization

Update README file to include information about bbappend file inclusion,
telling the users that 'virtualization' needs to be in DISTRO_FEATURES
to make some bbappend files to be effective.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 README | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/README b/README
index 2578f90..49fda10 100644
--- a/README
+++ b/README
@@ -4,6 +4,11 @@ meta-virtualization
 This layer provides support for building Xen, KVM, Libvirt, and associated
 packages necessary for constructing OE-based virtualized solutions.
 
+The bbappend files for some recipe (e.g. linux-yocto) in this layer need to
+have 'virtualization' in DISTRO_FEATURES to have effect. To enable them, add
+in configuration file the following line.
+DISTRO_FEATURES_append = " virtualization"
+
 Dependencies
 ------------
 This layer depends on:
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking
  2017-09-30  3:06 [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking Chen Qi
  2017-09-30  3:06 ` [PATCH V4 2/3] linux-yocto: make bbappend have effect conditionally Chen Qi
  2017-09-30  3:06 ` [PATCH V4 3/3] README: update to include information about bbappend inclusion Chen Qi
@ 2017-10-02 17:12 ` Bruce Ashfield
  2017-10-05 16:15   ` Paul Barker
  2 siblings, 1 reply; 8+ messages in thread
From: Bruce Ashfield @ 2017-10-02 17:12 UTC (permalink / raw)
  To: Chen Qi; +Cc: meta-virtualization

v4 is merged.

Bruce

On Fri, Sep 29, 2017 at 11:06 PM, Chen Qi <Qi.Chen@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@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@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"


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking
  2017-10-02 17:12 ` [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking Bruce Ashfield
@ 2017-10-05 16:15   ` Paul Barker
  2017-10-05 16:33     ` Mark Hatle
  2017-10-05 19:48     ` Bruce Ashfield
  0 siblings, 2 replies; 8+ messages in thread
From: Paul Barker @ 2017-10-05 16:15 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking
  2017-10-05 16:15   ` Paul Barker
@ 2017-10-05 16:33     ` Mark Hatle
  2017-10-05 19:48     ` Bruce Ashfield
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Hatle @ 2017-10-05 16:33 UTC (permalink / raw)
  To: Paul Barker, Bruce Ashfield; +Cc: meta-virtualization

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

Multiple times should get fixed.  This can be done by setting a value in the
event handler that the message has already been printed.

d.setVar('SKIP_SANITY_BBAPPEND_CHECK', '1')

...

--Mark

> 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,
> 



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking
  2017-10-05 16:15   ` Paul Barker
  2017-10-05 16:33     ` Mark Hatle
@ 2017-10-05 19:48     ` Bruce Ashfield
  2017-10-12 13:25       ` Paul Barker
  1 sibling, 1 reply; 8+ messages in thread
From: Bruce Ashfield @ 2017-10-05 19:48 UTC (permalink / raw)
  To: Paul Barker; +Cc: meta-virtualization

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking
  2017-10-05 19:48     ` Bruce Ashfield
@ 2017-10-12 13:25       ` Paul Barker
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Barker @ 2017-10-12 13:25 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization

On Thu, Oct 5, 2017 at 8:48 PM, Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> On Thu, Oct 5, 2017 at 12:15 PM, Paul Barker <pbarker@toganlabs.com> wrote:
>>
>> 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.
>

Patch incoming as soon as my current builds are done :)

-- 
Paul Barker
Togán Labs Ltd


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-10-12 13:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-30  3:06 [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking Chen Qi
2017-09-30  3:06 ` [PATCH V4 2/3] linux-yocto: make bbappend have effect conditionally Chen Qi
2017-09-30  3:06 ` [PATCH V4 3/3] README: update to include information about bbappend inclusion Chen Qi
2017-10-02 17:12 ` [PATCH V4 1/3] sanity-meta-virt.bbclass: add class for bbappend files checking Bruce Ashfield
2017-10-05 16:15   ` Paul Barker
2017-10-05 16:33     ` Mark Hatle
2017-10-05 19:48     ` Bruce Ashfield
2017-10-12 13:25       ` Paul Barker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.