summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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}"
103HOST_AS_ARCH = "${SDK_AS_ARCH}" 103HOST_AS_ARCH = "${SDK_AS_ARCH}"
104 104
105#assign DPKG_ARCH 105#assign DPKG_ARCH
106DPKG_ARCH = "${SDK_ARCH}" 106DPKG_ARCH = "${@debian_arch_map(d.getVar('SDK_ARCH', True), '')}"
107 107
108CPPFLAGS = "${BUILDSDK_CPPFLAGS}" 108CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
109CFLAGS = "${BUILDSDK_CFLAGS}" 109CFLAGS = "${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
6 6
7IMAGE_PKGTYPE ?= "deb" 7IMAGE_PKGTYPE ?= "deb"
8 8
9DPKG_ARCH ?= "${TARGET_ARCH}" 9DPKG_ARCH ?= "${@debian_arch_map(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEATURES', True))}"
10 10
11PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs" 11PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
12 12
@@ -14,6 +14,28 @@ APTCONF_TARGET = "${WORKDIR}"
14 14
15APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}" 15APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
16 16
17def 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
314do_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
292do_package_deb[vardepsexclude] = "OVERRIDES" 316do_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
325python do_package_write_deb () { 340python do_package_write_deb () {