summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-05-09 17:24:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-12 09:37:31 +0100
commitd63c8a1597c9bd0a838cb59ca461ac432b630a90 (patch)
treeb5cf754d14339ec60aba3e9db344c343bc32bffe
parent7b3bf9aaa181c6572def0cfe2b9f04a62a3027d5 (diff)
downloadpoky-d63c8a1597c9bd0a838cb59ca461ac432b630a90.tar.gz
classes/image: show an error on invalid IMAGE_FEATURES
If the user specifies an invalid feature in IMAGE_FEATURES, show an error during parsing. Valid IMAGE_FEATURES are drawn from PACKAGE_GROUP_ definitions, COMPLEMENTARY_GLOBS and a new 'validitems' varflag on IMAGE_FEATURES (so that additional non-package group features can be added elsewhere.) Implements [YOCTO #3308]. (From OE-Core rev: 8d25442ab795ff0f8e072da2022108eff128e2b2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/image.bbclass16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 251bc9abfd..2b42e123ed 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -19,6 +19,7 @@ INHIBIT_DEFAULT_DEPS = "1"
19# IMAGE_FEATURES may contain any available package group 19# IMAGE_FEATURES may contain any available package group
20IMAGE_FEATURES ?= "" 20IMAGE_FEATURES ?= ""
21IMAGE_FEATURES[type] = "list" 21IMAGE_FEATURES[type] = "list"
22IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs"
22 23
23# rootfs bootstrap install 24# rootfs bootstrap install
24ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}" 25ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"
@@ -62,6 +63,19 @@ IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}'
62SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs" 63SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs"
63SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}' 64SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}'
64 65
66def check_image_features(d):
67 valid_features = (d.getVarFlag('IMAGE_FEATURES', 'validitems', True) or "").split()
68 valid_features += d.getVarFlags('COMPLEMENTARY_GLOB').keys()
69 for var in d:
70 if var.startswith("PACKAGE_GROUP_"):
71 valid_features.append(var[14:])
72 valid_features.sort()
73
74 features = set(oe.data.typed_value('IMAGE_FEATURES', d))
75 for feature in features:
76 if feature not in valid_features:
77 bb.fatal("'%s' in IMAGE_FEATURES is not a valid image feature. Valid features: %s" % (feature, ' '.join(valid_features)))
78
65IMAGE_INSTALL ?= "" 79IMAGE_INSTALL ?= ""
66IMAGE_INSTALL[type] = "list" 80IMAGE_INSTALL[type] = "list"
67export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL} ${FEATURE_INSTALL}" 81export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL} ${FEATURE_INSTALL}"
@@ -129,6 +143,8 @@ python () {
129 vendor = localdata.getVar("TARGET_VENDOR_virtclass-multilib-" + eext[1], False) 143 vendor = localdata.getVar("TARGET_VENDOR_virtclass-multilib-" + eext[1], False)
130 ml_vendor_list += " " + vendor 144 ml_vendor_list += " " + vendor
131 d.setVar('MULTILIB_VENDORS', ml_vendor_list) 145 d.setVar('MULTILIB_VENDORS', ml_vendor_list)
146
147 check_image_features(d)
132} 148}
133 149
134# 150#