diff options
Diffstat (limited to 'yocto-poky/meta/classes/package_deb.bbclass')
-rw-r--r-- | yocto-poky/meta/classes/package_deb.bbclass | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/yocto-poky/meta/classes/package_deb.bbclass b/yocto-poky/meta/classes/package_deb.bbclass index d2fea4fcc..e1d05a74c 100644 --- a/yocto-poky/meta/classes/package_deb.bbclass +++ b/yocto-poky/meta/classes/package_deb.bbclass @@ -6,7 +6,8 @@ inherit package IMAGE_PKGTYPE ?= "deb" -DPKG_ARCH ?= "${TARGET_ARCH}" +DPKG_ARCH ?= "${@debian_arch_map(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEATURES', True))}" +DPKG_ARCH[vardepvalue] = "${DPKG_ARCH}" PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs" @@ -14,6 +15,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: @@ -21,7 +44,7 @@ APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", Tr # INSTALL_BASEARCH_DEB - install base architecutre # INSTALL_ARCHS_DEB - list of available archs # INSTALL_PACKAGES_NORMAL_DEB - packages to be installed -# INSTALL_PACKAGES_ATTEMPTONLY_DEB - packages attemped to be installed only +# INSTALL_PACKAGES_ATTEMPTONLY_DEB - packages attempted to be installed only # INSTALL_PACKAGES_LINGUAS_DEB - additional packages for uclibc # INSTALL_TASK_DEB - task name @@ -139,6 +162,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: @@ -209,12 +234,15 @@ python do_package_deb () { rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS", True) or "") debian_cmp_remap(rdepends) - for dep in rdepends: + for dep in rdepends.keys(): + if dep == pkg: + del rdepends[dep] + continue if '*' in dep: del rdepends[dep] rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "") debian_cmp_remap(rrecommends) - for dep in rrecommends: + for dep in rrecommends.keys(): if '*' in dep: del rrecommends[dep] rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS", True) or "") @@ -288,6 +316,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 +341,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 () { |