* [PATCH v3 1/4] package_deb.bbclass, cross-canadian.bbclass: DPKG_ARCH mapping function
2016-01-06 12:21 [PATCH v3 0/4] Debian multilib packaging fixes Matt Madison
@ 2016-01-06 12:21 ` Matt Madison
2016-01-06 12:21 ` [PATCH v3 2/4] package_manager.py: fixes for multilib deb packaging builds Matt Madison
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Matt Madison @ 2016-01-06 12:21 UTC (permalink / raw)
To: openembedded-core
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
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v3 2/4] package_manager.py: fixes for multilib deb packaging builds
2016-01-06 12:21 [PATCH v3 0/4] Debian multilib packaging fixes Matt Madison
2016-01-06 12:21 ` [PATCH v3 1/4] package_deb.bbclass, cross-canadian.bbclass: DPKG_ARCH mapping function Matt Madison
@ 2016-01-06 12:21 ` Matt Madison
2016-01-06 12:21 ` [PATCH v3 3/4] package_deb.bbclass: add 'Multi-Arch: foreign' tag to allarch packages Matt Madison
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Matt Madison @ 2016-01-06 12:21 UTC (permalink / raw)
To: openembedded-core
* tmp/deploy/deb subdirectories do not get hyphens replaced
with underscores, so don't do that translation when building
the sources list.
* Fix MULTILIB_VARIANTS handling to be more general and
work for all architectures
* Also include a fix for a warning generated by apt
due to missing apt/preferences.d directory.
Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
meta/lib/oe/package_manager.py | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 32afeaf..bc39721 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -247,7 +247,7 @@ class DpkgIndexer(Indexer):
if a not in pkg_archs:
arch_list.append(a)
- all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
+ all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").split()
arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in arch_list)
apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive")
@@ -1775,7 +1775,7 @@ class DpkgPM(PackageManager):
self.apt_args = d.getVar("APT_ARGS", True)
self.all_arch_list = archs.split()
- all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
+ all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").split()
self.all_arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in self.all_arch_list)
self._create_configs(archs, base_archs)
@@ -1966,6 +1966,7 @@ class DpkgPM(PackageManager):
bb.utils.mkdirhier(self.apt_conf_dir)
bb.utils.mkdirhier(self.apt_conf_dir + "/lists/partial/")
bb.utils.mkdirhier(self.apt_conf_dir + "/apt.conf.d/")
+ bb.utils.mkdirhier(self.apt_conf_dir + "/preferences.d/")
arch_list = []
for arch in self.all_arch_list:
@@ -2000,10 +2001,14 @@ class DpkgPM(PackageManager):
base_arch_list = base_archs.split()
multilib_variants = self.d.getVar("MULTILIB_VARIANTS", True);
for variant in multilib_variants.split():
- if variant == "lib32":
- base_arch_list.append("i386")
- elif variant == "lib64":
- base_arch_list.append("amd64")
+ localdata = bb.data.createCopy(self.d)
+ variant_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + variant, False)
+ orig_arch = localdata.getVar("DPKG_ARCH", True)
+ localdata.setVar("DEFAULTTUNE", variant_tune)
+ bb.data.update_data(localdata)
+ variant_arch = localdata.getVar("DPKG_ARCH", True)
+ if variant_arch not in base_arch_list:
+ base_arch_list.append(variant_arch)
with open(self.apt_conf_file, "w+") as apt_conf:
with open(self.d.expand("${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample")) as apt_conf_sample:
--
2.5.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v3 3/4] package_deb.bbclass: add 'Multi-Arch: foreign' tag to allarch packages
2016-01-06 12:21 [PATCH v3 0/4] Debian multilib packaging fixes Matt Madison
2016-01-06 12:21 ` [PATCH v3 1/4] package_deb.bbclass, cross-canadian.bbclass: DPKG_ARCH mapping function Matt Madison
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 ` 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
4 siblings, 0 replies; 6+ messages in thread
From: Matt Madison @ 2016-01-06 12:21 UTC (permalink / raw)
To: openembedded-core
This tells APT that it can use such packages to resolve dependencies
from packages of any architecture in a multilib build.
Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
meta/classes/package_deb.bbclass | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 8d27adf..25218d0 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -161,6 +161,8 @@ python do_package_deb () {
return l2
ctrlfile.write("Package: %s\n" % pkgname)
+ if d.getVar('PACKAGE_ARCH', True) == "all":
+ ctrlfile.write("Multi-Arch: foreign\n")
# check for required fields
try:
for (c, fs) in fields:
--
2.5.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v3 4/4] DpkgRootfs: Fix logcheck_error false-positive when use multilib
2016-01-06 12:21 [PATCH v3 0/4] Debian multilib packaging fixes Matt Madison
` (2 preceding siblings ...)
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 ` Matt Madison
2016-01-06 12:27 ` [PATCH v3 0/4] Debian multilib packaging fixes Matt Madison
4 siblings, 0 replies; 6+ messages in thread
From: Matt Madison @ 2016-01-06 12:21 UTC (permalink / raw)
To: openembedded-core
From: Aníbal Limón <anibal.limon@linux.intel.com>
Rootfs with dpkg was failing due to false-positive in logcheck_error
because current logic of DpkgPM handles missing dependencies failure
using apt-get -f install [1][2].
This support was broken due to addition of logcheck and don't take into
account dpkgpm cases, in order to fix add an attr for specify expected
errors regex'es by package manager.
[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/lib/oe/rootfs.py#n659
[2] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/lib/oe/package_manager.py#n2038
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Matt Madison <matt@madison.systems>
---
meta/lib/oe/rootfs.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index a2af332..f677d03 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -63,6 +63,15 @@ class Rootfs(object):
if 'log_check' in line:
continue
+ if hasattr(self, 'log_check_expected_errors_regexes'):
+ m = None
+ for ee in self.log_check_expected_errors_regexes:
+ m = re.search(ee, line)
+ if m:
+ break
+ if m:
+ continue
+
m = r.search(line)
if m:
found_error = 1
@@ -623,6 +632,10 @@ class DpkgRootfs(DpkgOpkgRootfs):
def __init__(self, d, manifest_dir):
super(DpkgRootfs, self).__init__(d)
self.log_check_regex = '^E:'
+ self.log_check_expected_errors_regexes = \
+ [
+ "^E: Unmet dependencies."
+ ]
bb.utils.remove(self.image_rootfs, True)
bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS', True), True)
--
2.5.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v3 0/4] Debian multilib packaging fixes
2016-01-06 12:21 [PATCH v3 0/4] Debian multilib packaging fixes Matt Madison
` (3 preceding siblings ...)
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 ` Matt Madison
4 siblings, 0 replies; 6+ messages in thread
From: Matt Madison @ 2016-01-06 12:27 UTC (permalink / raw)
To: openembedded-core@lists.openembedded.org
It would be great if these could be pulled into jethro as well, since
that's where I first noticed that multilib Debian builds were broken.
-Matt
On Wed, Jan 6, 2016 at 4:21 AM, Matt Madison <matt@madison.systems> wrote:
> This version adds a fourth patch from Aníbal to skip any
> "unmet dependencies" errors reported by APT from the initial
> install, which were prematurely terminating the rootfs build.
>
> Aníbal Limón (1):
> DpkgRootfs: Fix logcheck_error false-positive when use multilib
>
> Matt Madison (3):
> package_deb.bbclass, cross-canadian.bbclass: DPKG_ARCH mapping
> function
> package_manager.py: fixes for multilib deb packaging builds
> package_deb.bbclass: add 'Multi-Arch: foreign' tag to allarch packages
>
> meta/classes/cross-canadian.bbclass | 2 +-
> meta/classes/package_deb.bbclass | 37 +++++++++++++++++++++++++++----------
> meta/lib/oe/package_manager.py | 17 +++++++++++------
> meta/lib/oe/rootfs.py | 13 +++++++++++++
> 4 files changed, 52 insertions(+), 17 deletions(-)
>
> --
> 2.5.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread