summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2016-01-06 04:21:33 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-11 23:23:17 +0000
commit8d042ea4e755cb0bb28b88333e10e04ec4e86a36 (patch)
tree93ea5a3ff2ec435545eb22006d1e208075caef6a
parentbcb5a6866e9233bcb69a9ee06faed622280a6c22 (diff)
downloadopenembedded-core-contrib-8d042ea4e755cb0bb28b88333e10e04ec4e86a36.tar.gz
openembedded-core-contrib-8d042ea4e755cb0bb28b88333e10e04ec4e86a36.tar.bz2
openembedded-core-contrib-8d042ea4e755cb0bb28b88333e10e04ec4e86a36.zip
package_deb.bbclass, cross-canadian.bbclass: DPKG_ARCH mapping function
Have DPKG_ARCH set by directly invoking a mapping function, rather than using an anonymous Python function modify the variable under the hood, so we can have proper handling of overrides. Also bring in some additional mappings to Debian architecture names that weren't being handled. Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/classes/cross-canadian.bbclass2
-rw-r--r--meta/classes/package_deb.bbclass35
2 files changed, 26 insertions, 11 deletions
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
index 7b26ed631b..e07b1bdb6c 100644
--- a/meta/classes/cross-canadian.bbclass
+++ b/meta/classes/cross-canadian.bbclass
@@ -103,7 +103,7 @@ HOST_LD_ARCH = "${SDK_LD_ARCH}"
HOST_AS_ARCH = "${SDK_AS_ARCH}"
#assign DPKG_ARCH
-DPKG_ARCH = "${SDK_ARCH}"
+DPKG_ARCH = "${@debian_arch_map(d.getVar('SDK_ARCH', True), '')}"
CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
CFLAGS = "${BUILDSDK_CFLAGS}"
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 5feeeb0ecc..8d27adf292 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -6,7 +6,7 @@ inherit package
IMAGE_PKGTYPE ?= "deb"
-DPKG_ARCH ?= "${TARGET_ARCH}"
+DPKG_ARCH ?= "${@debian_arch_map(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEATURES', True))}"
PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
@@ -14,6 +14,28 @@ APTCONF_TARGET = "${WORKDIR}"
APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
+def debian_arch_map(arch, tune):
+ tune_features = tune.split()
+ if arch in ["i586", "i686"]:
+ return "i386"
+ if arch == "x86_64":
+ if "mx32" in tune_features:
+ return "x32"
+ return "amd64"
+ if arch.startswith("mips"):
+ endian = ["el", ""]["bigendian" in tune_features]
+ if "n64" in tune_features:
+ return "mips64" + endian
+ if "n32" in tune_features:
+ return "mipsn32" + endian
+ return "mips" + endian
+ if arch == "powerpc":
+ return arch + ["", "spe"]["spe" in tune_features]
+ if arch == "aarch64":
+ return "arm64"
+ if arch == "arm":
+ return arch + ["el", "hf"]["callconvention-hard" in tune_features]
+ return arch
#
# install a bunch of packages using apt
# the following shell variables needs to be set before calling this func:
@@ -288,6 +310,8 @@ python do_package_deb () {
cleanupcontrol(root)
bb.utils.unlockfile(lf)
}
+# Indirect references to these vars
+do_package_write_deb[vardeps] += "PKGV PKGR PKGV DESCRIPTION SECTION PRIORITY MAINTAINER DPKG_ARCH PN HOMEPAGE"
# Otherwise allarch packages may change depending on override configuration
do_package_deb[vardepsexclude] = "OVERRIDES"
@@ -311,15 +335,6 @@ python () {
deps = ' dpkg-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
d.appendVarFlag('do_package_write_deb', 'depends', deps)
d.setVarFlag('do_package_write_deb', 'fakeroot', "1")
-
- # Map TARGET_ARCH to Debian's ideas about architectures
- darch = d.getVar('DPKG_ARCH', True)
- if darch in ["x86", "i486", "i586", "i686", "pentium"]:
- d.setVar('DPKG_ARCH', 'i386')
- elif darch == "x86_64":
- d.setVar('DPKG_ARCH', 'amd64')
- elif darch == "arm":
- d.setVar('DPKG_ARCH', 'armel')
}
python do_package_write_deb () {