multilib: bug fixes related with RPM backend
Hi Richard,
This pull request is to fix several multilib bugs related with RPM backend, please help to review and pull.
Changes from v1:
- Add a patch to handle PACKAGES dynamic setting in libc-package.bbclass in
multilib case. Otherwise IPK packaging logic will not find the correct locale-base-* packages.
I've done a round of multilib testing agasint for following combinations for both RPM and IPK packaging:
- lib32 sato image on qemux86 machine
- lib32 sato image on qemux86-64 machine
- lib64 sato image on qemux86-64 machine
- lib64 sato image on qemux86 machine (build pass but cannot boot)
- sato image on qemux86-64 with several lib32 packages (lib32-connman)
All the above test cases can pass the build and most can successfully boot up (except the lib64 on qemux86 since 64bit code could not run on 32bit machine).
Therefore the following bugs could be addressed:
[YOCTO #1496]
[YOCTO #1497]
[YOCTO #1498]
[YOCTO #1527]
Thanks,
Dongxiao
The following changes since commit 684a4b517d13884c315688967fadd5e6a4845b71:
libffi: really populate -dev package (2011-09-26 20:50:27 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib dxu4/ml
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dxu4/ml
Dongxiao Xu (6):
multilib.bbclass: map RDEPENDS and LINGUAS_INSTALL for image recipes
multilib: remove the multilib handling to allarch
multilib: add MLPREFIX to deploy folder
tune-i586: fix hardcoded TUNE_PKGARCH
package_rpm: combine normal and multilib solution manifest together libc-package.bbclass: add MLPREFIX when set values to PACKAGES
meta/classes/libc-package.bbclass | 2 +- meta/classes/multilib.bbclass | 12 +++++------- meta/classes/multilib_global.bbclass | 2 +- meta/classes/package_rpm.bbclass | 15 +++++++++++---- meta/classes/rootfs_rpm.bbclass | 2 +- meta/conf/machine/include/tune-i586.inc | 3 ++- meta/conf/multilib.conf | 7 +++++++ .../python/python-pygobject_2.27.91.bb | 2 +- 8 files changed, 29 insertions(+), 16 deletions(-)
PATCH 1/6 multilib.bbclass: map RDEPENDS and LINGUAS_INSTALL for image recipes
RDEPENDS of image type recipe needs to be mapped to make sure that the packages included in the image should be multilib version.
Also add LINGUAS_INSTALL into MULTILIB_PACKAGE_INSTALL list.
[YOCTO #1496]
[YOCTO #1527]
--- meta/classes/multilib.bbclass | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
meta/classes/multilib.bbclass +4 -1
@@ -54,9 +54,12 @@ python __anonymous () { if bb.data.inherits_class('image', d): map_dependencies("PACKAGE_INSTALL", d) - pinstall = d.getVar("PACKAGE_INSTALL", True) + " " + d.getVar("MULTILIB_PACKAGE_INSTALL", False) + map_dependencies("LINGUAS_INSTALL", d) + map_dependencies("RDEPENDS", d) + pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True) + " " + d.getVar("MULTILIB_PACKAGE_INSTALL", False) d.setVar("MULTILIB_PACKAGE_INSTALL", pinstall) d.setVar("PACKAGE_INSTALL", "") + d.setVar("LINGUAS_INSTALL", "") # FIXME, we need to map this to something, not delete it! d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", "") return
Signature · 1 line
1.7.1
PATCH 2/6 multilib: remove the multilib handling to allarch
In reply to Dongxiao Xucurrently we have allarch type of recipes, which may still have architecture dependency, like x11-common. So we need to drop the handling to allarch in multilib case.
Also remove the PV postfix in python-pygobject DEPENDS, since multilib code will treat a native package multilib capable.
[YOCTO #1497]
[YOCTO #1498]
--- meta/classes/multilib.bbclass | 2 +- meta/classes/multilib_global.bbclass | 2 +- meta/conf/multilib.conf | 7 +++++++ .../python/python-pygobject_2.27.91.bb | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-)
meta/classes/multilib.bbclass +1 -1
@@ -8,7 +8,7 @@ python multilib_virtclass_handler () { return # There should only be one kernel in multilib configs - if bb.data.inherits_class('kernel', e.data) or bb.data.inherits_class('module-base', e.data) or bb.data.inherits_class('allarch', e.data): + if bb.data.inherits_class('kernel', e.data) or bb.data.inherits_class('module-base', e.data): raise bb.parse.SkipPackage("We shouldn't have multilib variants for the kernel") if bb.data.inherits_class('image', e.data):
meta/classes/multilib_global.bbclass +1 -1
@@ -5,7 +5,7 @@ python multilib_virtclass_handler_global () { variant = e.data.getVar("BBEXTENDVARIANT", True) if isinstance(e, bb.event.RecipeParsed) and not variant: - if bb.data.inherits_class('kernel', e.data) or bb.data.inherits_class('module-base', e.data) or bb.data.inherits_class('allarch', e.data): + if bb.data.inherits_class('kernel', e.data) or bb.data.inherits_class('module-base', e.data): variants = (e.data.getVar("MULTILIB_VARIANTS", True) or "").split() # Process PROVIDES
meta/conf/multilib.conf +7 -0
@@ -452,3 +452,10 @@ BBCLASSEXTEND_append_pn-zip = " ${MULTILIBS}" BBCLASSEXTEND_append_pn-zlib = " ${MULTILIBS}" BBCLASSEXTEND_append_pn-zypper = " ${MULTILIBS}" BBCLASSEXTEND_append_pn-libsdl = " ${MULTILIBS}" +BBCLASSEXTEND_append_pn-qemu-config = " ${MULTILIBS}" +BBCLASSEXTEND_append_pn-x11-common = " ${MULTILIBS}" +BBCLASSEXTEND_append_pn-update-rc.d = " ${MULTILIBS}" +BBCLASSEXTEND_append_pn-avahi-ui = " ${MULTILIBS}" +BBCLASSEXTEND_append_pn-python-pycairo = " ${MULTILIBS}" +BBCLASSEXTEND_append_pn-python-pygtk = " ${MULTILIBS}" +BBCLASSEXTEND_append_pn-python-pygobject = " ${MULTILIBS}"
meta/recipes-devtools/python/python-pygobject_2.27.91.bb +1 -1
@@ -2,7 +2,7 @@ DESCRIPTION = "Python GObject bindings" SECTION = "devel/python" LICENSE = "LGPLv2.1" LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7" -DEPENDS = "python python-pygobject-native-${PV} glib-2.0" +DEPENDS = "python python-pygobject-native glib-2.0" DEPENDS_virtclass-native = "glib-2.0-native" RDEPENDS_virtclass-native = "" PR = "r2"
Signature · 1 line
1.7.1
PATCH 3/6 multilib: add MLPREFIX to deploy folder
In reply to Dongxiao XuAdd MLPREFIX to multilib deploy forlder to avoid the confliction between multilib and normal package deploy directory.
--- meta/classes/multilib.bbclass | 5 ----- meta/classes/package_rpm.bbclass | 10 ++++++++-- meta/classes/rootfs_rpm.bbclass | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-)
meta/classes/multilib.bbclass +0 -5
@@ -92,9 +92,4 @@ python __anonymous () { multilib_map_variable("PACKAGES_DYNAMIC", variant, d) multilib_map_variable("PACKAGE_INSTALL", variant, d) multilib_map_variable("INITSCRIPT_PACKAGES", variant, d) - - package_arch = d.getVar("PACKAGE_ARCH", True) - machine_arch = d.getVar("MACHINE_ARCH", True) - if package_arch == machine_arch: - d.setVar("PACKAGE_ARCH", variant + "_" + package_arch) }
meta/classes/package_rpm.bbclass +8 -2
@@ -903,8 +903,14 @@ python do_package_rpm () { rpmbuild = bb.data.getVar('RPMBUILD', d, True) targetsys = bb.data.getVar('TARGET_SYS', d, True) targetvendor = bb.data.getVar('TARGET_VENDOR', d, True) - pkgwritedir = bb.data.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH}', d) - pkgarch = bb.data.expand('${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}', d) + package_arch = bb.data.getVar('PACKAGE_ARCH', d, True) or "" + if package_arch not in "all any noarch".split(): + ml_prefix = (bb.data.getVar('MLPREFIX', d, True) or "").replace("-", "_") + bb.data.setVar('PACKAGE_ARCH_EXTEND', ml_prefix + package_arch, d) + else: + bb.data.setVar('PACKAGE_ARCH_EXTEND', package_arch, d) + pkgwritedir = bb.data.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH_EXTEND}', d) + pkgarch = bb.data.expand('${PACKAGE_ARCH_EXTEND}${TARGET_VENDOR}-${TARGET_OS}', d) magicfile = bb.data.expand('${STAGING_DIR_NATIVE}/usr/share/misc/magic.mgc', d) bb.mkdirhier(pkgwritedir) os.chmod(pkgwritedir, 0755)
meta/classes/rootfs_rpm.bbclass +1 -1
@@ -220,8 +220,8 @@ python () { default_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + eext[1], False) if default_tune: localdata.setVar("DEFAULTTUNE", default_tune) - localdata.setVar("MACHINE_ARCH", eext[1] + "_" + localdata.getVar("MACHINE_ARCH", False)) package_archs = localdata.getVar("PACKAGE_ARCHS", True) or "" + package_archs = " ".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()]) ml_package_archs += " " + package_archs ml_prefix_list += " " + eext[1] #bb.note("ML_PACKAGE_ARCHS %s %s %s" % (eext[1], localdata.getVar("PACKAGE_ARCHS", True) or "(none)", overrides))
Signature · 1 line
1.7.1
PATCH 4/6 tune-i586: fix hardcoded TUNE_PKGARCH
In reply to Dongxiao XuUse TUNE_FEATURES to determine the setting to TUNE_PKGARCH, which fixes the wrong setting of PACKAGE_ARCH in multilib case.
--- meta/conf/machine/include/tune-i586.inc | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
meta/conf/machine/include/tune-i586.inc +2 -1
@@ -1,5 +1,6 @@ DEFAULTTUNE ?= "i586" -TUNE_PKGARCH ?= "i586" +TUNE_PKGARCH_TMP = "${@bb.utils.contains("TUNE_FEATURES", "m32", "x86", "x86_64", d)}" +TUNE_PKGARCH ?= "${@bb.utils.contains("TUNE_FEATURES", "i586", "i586", TUNE_PKGARCH_TMP, d)}" require conf/machine/include/ia32/arch-ia32.inc
Signature · 1 line
1.7.1
PATCH 5/6 package_rpm: combine normal and multilib solution manifest together
In reply to Dongxiao XuWhen RPM does the real install, if the first manifest file is empty, the installation will stop without handling the second manifest file.
Merge the two manifest files together to fix this issue.
--- meta/classes/package_rpm.bbclass | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
meta/classes/package_rpm.bbclass +3 -2
@@ -395,6 +395,8 @@ package_install_internal_rpm () { -D "__dbi_txn create nofsync private" \ | grep -i 'Packageorigin' | cut -d : -f 2 > ${target_rootfs}/install/install_multilib_solution.manifest + cat ${target_rootfs}/install/install_solution.manifest > ${target_rootfs}/install/total_solution.manifest + cat ${target_rootfs}/install/install_multilib_solution.manifest >> ${target_rootfs}/install/total_solution.manifest # Attempt install ${RPM} --root ${target_rootfs} \
@@ -403,8 +405,7 @@ package_install_internal_rpm () { -D "_dbpath ${rpmlibdir}" \ --noscripts --notriggers --noparentdirs --nolinktos --replacepkgs \ -D "__dbi_txn create nofsync private" \ - -Uhv ${target_rootfs}/install/install_solution.manifest \ - ${target_rootfs}/install/install_multilib_solution.manifest + -Uhv ${target_rootfs}/install/total_solution.manifest } python write_specfile () {
Signature · 1 line
1.7.1
PATCH 6/6 libc-package.bbclass: add MLPREFIX when set values to PACKAGES
In reply to Dongxiao XuThere are some places that PACKAGES are dynamically set. To support multilib, we need to add MLPREFIX before the package name in those settings.
--- meta/classes/libc-package.bbclass | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
meta/classes/libc-package.bbclass +1 -1
@@ -311,7 +311,7 @@ python package_do_split_gconvs () { raise bb.build.FuncFailed("localedef returned an error") def output_locale(name, locale, encoding): - pkgname = 'locale-base-' + legitimize_package_name(name) + pkgname = bb.data.getVar('MLPREFIX', d) + 'locale-base-' + legitimize_package_name(name) bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d) bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d) rprovides = ' virtual-locale-%s' % legitimize_package_name(name)
Signature · 1 line
1.7.1