From: Matt Madison <matt@madison.systems>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v3 1/4] package_deb.bbclass, cross-canadian.bbclass: DPKG_ARCH mapping function
Date: Wed, 6 Jan 2016 04:21:33 -0800 [thread overview]
Message-ID: <1452082896-3261-2-git-send-email-matt@madison.systems> (raw)
In-Reply-To: <1452082896-3261-1-git-send-email-matt@madison.systems>
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>
---
meta/classes/cross-canadian.bbclass | 2 +-
meta/classes/package_deb.bbclass | 35 +++++++++++++++++++++++++----------
2 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
index 7b26ed6..e07b1bd 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 5feeeb0..8d27adf 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 () {
--
2.5.0
next prev parent reply other threads:[~2016-01-06 12:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 12:21 [PATCH v3 0/4] Debian multilib packaging fixes Matt Madison
2016-01-06 12:21 ` Matt Madison [this message]
2016-01-06 12:21 ` [PATCH v3 2/4] package_manager.py: fixes for multilib deb packaging builds Matt Madison
2016-01-06 12:21 ` [PATCH v3 3/4] package_deb.bbclass: add 'Multi-Arch: foreign' tag to allarch packages Matt Madison
2016-01-06 12:21 ` [PATCH v3 4/4] DpkgRootfs: Fix logcheck_error false-positive when use multilib Matt Madison
2016-01-06 12:27 ` [PATCH v3 0/4] Debian multilib packaging fixes Matt Madison
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452082896-3261-2-git-send-email-matt@madison.systems \
--to=matt@madison.systems \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox