diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-05-09 17:24:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-12 09:37:31 +0100 |
commit | d63c8a1597c9bd0a838cb59ca461ac432b630a90 (patch) | |
tree | b5cf754d14339ec60aba3e9db344c343bc32bffe /meta | |
parent | 7b3bf9aaa181c6572def0cfe2b9f04a62a3027d5 (diff) | |
download | poky-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>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/image.bbclass | 16 |
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 |
20 | IMAGE_FEATURES ?= "" | 20 | IMAGE_FEATURES ?= "" |
21 | IMAGE_FEATURES[type] = "list" | 21 | IMAGE_FEATURES[type] = "list" |
22 | IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs" | ||
22 | 23 | ||
23 | # rootfs bootstrap install | 24 | # rootfs bootstrap install |
24 | ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}" | 25 | ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}" |
@@ -62,6 +63,19 @@ IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}' | |||
62 | SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs" | 63 | SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs" |
63 | SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}' | 64 | SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}' |
64 | 65 | ||
66 | def 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 | |||
65 | IMAGE_INSTALL ?= "" | 79 | IMAGE_INSTALL ?= "" |
66 | IMAGE_INSTALL[type] = "list" | 80 | IMAGE_INSTALL[type] = "list" |
67 | export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL} ${FEATURE_INSTALL}" | 81 | export 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 | # |