diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2017-09-30 11:06:15 +0800 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-10-02 09:39:26 -0400 |
commit | bfba140b8353665e1b586c257982c4cb3f496ec3 (patch) | |
tree | 951d3935af0b6ddcaefc2b411868b428a0feb2c1 | |
parent | b7febd5592a69f79cf194d4561eba2f76e504bd8 (diff) | |
download | meta-virtualization-bfba140b8353665e1b586c257982c4cb3f496ec3.tar.gz |
sanity-meta-virt.bbclass: add class for bbappend files checking
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>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r-- | classes/sanity-meta-virt.bbclass | 10 | ||||
-rw-r--r-- | conf/layer.conf | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/classes/sanity-meta-virt.bbclass b/classes/sanity-meta-virt.bbclass new file mode 100644 index 00000000..bd2b7172 --- /dev/null +++ b/classes/sanity-meta-virt.bbclass | |||
@@ -0,0 +1,10 @@ | |||
1 | addhandler virt_bbappend_distrocheck | ||
2 | virt_bbappend_distrocheck[eventmask] = "bb.event.ConfigParsed" | ||
3 | python virt_bbappend_distrocheck() { | ||
4 | skip_check = e.data.getVar('SKIP_SANITY_BBAPPEND_CHECK') == "1" | ||
5 | if 'virtualization' not in e.data.getVar('DISTRO_FEATURES').split() and not skip_check: | ||
6 | bb.warn("You have included the meta-virtualization layer, but \ | ||
7 | 'virtualization' has not been enabled in your DISTRO_FEATURES. Some bbappend files \ | ||
8 | may not take effect. See the meta-virtualization README for details on enabling \ | ||
9 | virtualization support.") | ||
10 | } | ||
diff --git a/conf/layer.conf b/conf/layer.conf index be08a985..51ca8ee2 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
@@ -22,3 +22,7 @@ require conf/distro/include/virt_security_flags.inc | |||
22 | 22 | ||
23 | PREFERRED_PROVIDER_virtual/runc ?= "runc-docker" | 23 | PREFERRED_PROVIDER_virtual/runc ?= "runc-docker" |
24 | PREFERRED_PROVIDER_virtual/containerd ?= "containerd-docker" | 24 | PREFERRED_PROVIDER_virtual/containerd ?= "containerd-docker" |
25 | |||
26 | # Sanity check for meta-virtualization layer. | ||
27 | # Setting SKIP_SANITY_BBAPPEND_CHECK to "1" would skip the bbappend files check. | ||
28 | INHERIT += "sanity-meta-virt" | ||