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

Add a new class, sanity-bbappend.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-bbappend.bbclass | 10 ++++++++++
 conf/layer.conf                 |  4 ++++
 2 files changed, 14 insertions(+)
 create mode 100644 classes/sanity-bbappend.bbclass

diff --git a/classes/sanity-bbappend.bbclass b/classes/sanity-bbappend.bbclass
new file mode 100644
index 0000000..bd2b717
--- /dev/null
+++ b/classes/sanity-bbappend.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..341ad38 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 application of bbappend files.
+# Setting SKIP_SANITY_BBAPPEND_CHECK to "1" would skip the check.
+INHERIT += "sanity-bbappend"
-- 
2.11.0



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

end of thread, other threads:[~2017-09-25 14:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-25  8:41 [PATCH V2 1/3] sanity-bbappend.bbclass: add class for bbappend files checking Chen Qi
2017-09-25  8:41 ` [PATCH V2 2/3] linux-yocto: make bbappend have effect conditionally Chen Qi
2017-09-25  8:41 ` [PATCH V2 3/3] README: update to include information about bbappend inclusion Chen Qi
2017-09-25 10:40 ` [PATCH V2 1/3] sanity-bbappend.bbclass: add class for bbappend files checking Richard Purdie
2017-09-25 12:00   ` Rich Persaud
2017-09-25 12:45     ` Richard Purdie
2017-09-25 12:49   ` Bruce Ashfield
2017-09-25 13:10     ` Richard Purdie
2017-09-25 14:02       ` Bruce Ashfield

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.