diff options
author | Matt Madison <matt@madison.systems> | 2016-01-06 04:21:33 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-11 23:26:31 +0000 |
commit | 9ea7428e67a764185349bd5dd5ddafd1c33c3290 (patch) | |
tree | 2c4b6974095f141157e7ceacff40e99c340aaec5 /meta/classes/package_deb.bbclass | |
parent | 72e69328b383404c34dbd8725447024c788abe2b (diff) | |
download | poky-9ea7428e67a764185349bd5dd5ddafd1c33c3290.tar.gz |
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.
(From OE-Core rev: 8d042ea4e755cb0bb28b88333e10e04ec4e86a36)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_deb.bbclass')
-rw-r--r-- | meta/classes/package_deb.bbclass | 35 |
1 files changed, 25 insertions, 10 deletions
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 | |||
6 | 6 | ||
7 | IMAGE_PKGTYPE ?= "deb" | 7 | IMAGE_PKGTYPE ?= "deb" |
8 | 8 | ||
9 | DPKG_ARCH ?= "${TARGET_ARCH}" | 9 | DPKG_ARCH ?= "${@debian_arch_map(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEATURES', True))}" |
10 | 10 | ||
11 | PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs" | 11 | PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs" |
12 | 12 | ||
@@ -14,6 +14,28 @@ APTCONF_TARGET = "${WORKDIR}" | |||
14 | 14 | ||
15 | APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}" | 15 | APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}" |
16 | 16 | ||
17 | def debian_arch_map(arch, tune): | ||
18 | tune_features = tune.split() | ||
19 | if arch in ["i586", "i686"]: | ||
20 | return "i386" | ||
21 | if arch == "x86_64": | ||
22 | if "mx32" in tune_features: | ||
23 | return "x32" | ||
24 | return "amd64" | ||
25 | if arch.startswith("mips"): | ||
26 | endian = ["el", ""]["bigendian" in tune_features] | ||
27 | if "n64" in tune_features: | ||
28 | return "mips64" + endian | ||
29 | if "n32" in tune_features: | ||
30 | return "mipsn32" + endian | ||
31 | return "mips" + endian | ||
32 | if arch == "powerpc": | ||
33 | return arch + ["", "spe"]["spe" in tune_features] | ||
34 | if arch == "aarch64": | ||
35 | return "arm64" | ||
36 | if arch == "arm": | ||
37 | return arch + ["el", "hf"]["callconvention-hard" in tune_features] | ||
38 | return arch | ||
17 | # | 39 | # |
18 | # install a bunch of packages using apt | 40 | # install a bunch of packages using apt |
19 | # the following shell variables needs to be set before calling this func: | 41 | # the following shell variables needs to be set before calling this func: |
@@ -288,6 +310,8 @@ python do_package_deb () { | |||
288 | cleanupcontrol(root) | 310 | cleanupcontrol(root) |
289 | bb.utils.unlockfile(lf) | 311 | bb.utils.unlockfile(lf) |
290 | } | 312 | } |
313 | # Indirect references to these vars | ||
314 | do_package_write_deb[vardeps] += "PKGV PKGR PKGV DESCRIPTION SECTION PRIORITY MAINTAINER DPKG_ARCH PN HOMEPAGE" | ||
291 | # Otherwise allarch packages may change depending on override configuration | 315 | # Otherwise allarch packages may change depending on override configuration |
292 | do_package_deb[vardepsexclude] = "OVERRIDES" | 316 | do_package_deb[vardepsexclude] = "OVERRIDES" |
293 | 317 | ||
@@ -311,15 +335,6 @@ python () { | |||
311 | deps = ' dpkg-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot' | 335 | deps = ' dpkg-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot' |
312 | d.appendVarFlag('do_package_write_deb', 'depends', deps) | 336 | d.appendVarFlag('do_package_write_deb', 'depends', deps) |
313 | d.setVarFlag('do_package_write_deb', 'fakeroot', "1") | 337 | d.setVarFlag('do_package_write_deb', 'fakeroot', "1") |
314 | |||
315 | # Map TARGET_ARCH to Debian's ideas about architectures | ||
316 | darch = d.getVar('DPKG_ARCH', True) | ||
317 | if darch in ["x86", "i486", "i586", "i686", "pentium"]: | ||
318 | d.setVar('DPKG_ARCH', 'i386') | ||
319 | elif darch == "x86_64": | ||
320 | d.setVar('DPKG_ARCH', 'amd64') | ||
321 | elif darch == "arm": | ||
322 | d.setVar('DPKG_ARCH', 'armel') | ||
323 | } | 338 | } |
324 | 339 | ||
325 | python do_package_write_deb () { | 340 | python do_package_write_deb () { |