diff options
author | Christopher Larson <kergoth@gmail.com> | 2015-03-16 11:55:33 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2015-03-17 09:42:00 -0400 |
commit | 8a0ecb59fa9e23f690a8aecea8e1812d79f752e7 (patch) | |
tree | 9e9a39223ad0a8e868757c8f930a88a2398263ac /recipes-extended | |
parent | e1b0876fa9e70739844073af4d5a85de403c6e78 (diff) | |
download | meta-virtualization-8a0ecb59fa9e23f690a8aecea8e1812d79f752e7.tar.gz |
xen: avoid parse time errors for non-xen-archs
XEN_TARGET_ARCH, when expanded, would emit a bb.error(). Referencing
XEN_TARGET_ARCH in PACKAGECONFIG resulted in its expansion at the up front
parse time, rather than at compile time, so non-xen-supported-archs like
powerpc would see parse time errors, resulting in non-zero bitbake exit codes.
Naturally this isn't ideal, so instead have the mapping function return
'INVALID' in the unsupported case, and in anonymous python, raise SkipPackage
if the mapped architecture is invalid, so it's seen as unbuildable in that
case.
Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-extended')
-rw-r--r-- | recipes-extended/xen/xen-arch.inc | 2 | ||||
-rw-r--r-- | recipes-extended/xen/xen.inc | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/recipes-extended/xen/xen-arch.inc b/recipes-extended/xen/xen-arch.inc index bcf9f54b..fb0093e3 100644 --- a/recipes-extended/xen/xen-arch.inc +++ b/recipes-extended/xen/xen-arch.inc | |||
@@ -14,5 +14,5 @@ def map_xen_arch(a, d): | |||
14 | elif re.match("aarch64.*", a): return "arm64" | 14 | elif re.match("aarch64.*", a): return "arm64" |
15 | elif a in valid_archs: return a | 15 | elif a in valid_archs: return a |
16 | else: | 16 | else: |
17 | bb.error("cannot map '%s' to a xen architecture" % a) | 17 | return "INVALID" |
18 | 18 | ||
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc index 0e4136aa..432bf4d4 100644 --- a/recipes-extended/xen/xen.inc +++ b/recipes-extended/xen/xen.inc | |||
@@ -663,6 +663,11 @@ export STAGING_LIBDIR | |||
663 | export XEN_TARGET_ARCH = "${@map_xen_arch(d.getVar('TARGET_ARCH', True), d)}" | 663 | export XEN_TARGET_ARCH = "${@map_xen_arch(d.getVar('TARGET_ARCH', True), d)}" |
664 | export XEN_COMPILE_ARCH = "${@map_xen_arch(d.getVar('BUILD_ARCH', True), d)}" | 664 | export XEN_COMPILE_ARCH = "${@map_xen_arch(d.getVar('BUILD_ARCH', True), d)}" |
665 | 665 | ||
666 | python () { | ||
667 | if d.getVar('XEN_TARGET_ARCH', True) == 'INVALID': | ||
668 | raise bb.parse.SkipPackage('Cannot map `%s` to a xen architecture' % d.getVar('TARGET_ARCH', True)) | ||
669 | } | ||
670 | |||
666 | # hardcoded as Linux, as the only compatible hosts are Linux. | 671 | # hardcoded as Linux, as the only compatible hosts are Linux. |
667 | export XEN_OS = "Linux" | 672 | export XEN_OS = "Linux" |
668 | 673 | ||