Skip to contentSkip to conversation

multilib: bug fixes related with RPM backend

GIT PULL New Dongxiao Xu 1 participant 6 messages Sep 28, 2011

lore
Share & tools
lore
#0 lore raw

Hi Richard,

This pull request is to fix several multilib bugs related with RPM backend, please help to review and pull.

I've done a round of multilib testing agasint:
- 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
- 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 for the lib64 on qemux86).

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 (5):
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

 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 +-
 7 files changed, 28 insertions(+), 15 deletions(-)
#1 lore raw

PATCH 1/5 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
index 98f6911..0ea1038 100644
@@ -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
#2 lore raw

PATCH 2/5 multilib: remove the multilib handling to allarch

In reply to Dongxiao Xu

currently 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
index 0ea1038..6c0dd37 100644
@@ -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
index cd22163..2da66a5 100644
@@ -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
index 3133bf1..b9da33a 100644
@@ -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
index 9ff2fe7..fd696a5 100644
@@ -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
#3 lore raw

PATCH 3/5 multilib: add MLPREFIX to deploy folder

In reply to Dongxiao Xu

Add 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
index 6c0dd37..1aed2a9 100644
@@ -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
index 775d525..45de0f8 100644
@@ -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
index 5ac6bca..dd370b2 100644
@@ -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
#4 lore raw

PATCH 4/5 tune-i586: fix hardcoded TUNE_PKGARCH

In reply to Dongxiao Xu

Use 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
index ba655b9..a40ce18 100644
@@ -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
#5 lore raw

PATCH 5/5 package_rpm: combine normal and multilib solution manifest together

In reply to Dongxiao Xu

When 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
index 45de0f8..fa0d8c3 100644
@@ -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