Skip to contentSkip to conversation

misc smart/multilib filesystem fixes

PATCH New Mark Hatle 1 participant 3 messages Dec 14, 2012

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

The following set of patches requires the smart work that was sent to the list earlier. It corrects two issues. The first is that multilib packages did not get filtered through the complementary install process properly due to the RPM package arch renaming.

The second issue relates to attemptonly packages. If one of the packages has a failed dependency, it will stop the full set from being installed.

Both have been built and tests on x86_64 w/ x86 multilibs and qemuarm.

author
#1 lore raw

PATCH 1/2 classes/image: handle multilibs in complementary package lookup

From: Paul Eggleton <[email protected]>

For multilib the vendor string is altered, so we need to iterate over all of the multilib vendors when we do the glob processing for complementary packages.

In addition, the RPM package arch have been munged by adding the multilib identifier. This identifier needs to be stripped when generating the installed_packages list for the complementary lookup code to work.

---
 meta/classes/image.bbclass       |   16 +++++++++++++++-
 meta/classes/package_rpm.bbclass |    5 ++++-
 2 files changed, 19 insertions(+), 2 deletions(-)
meta/classes/image.bbclass +15 -1
index 1461144..8bf718a 100644
@@ -113,6 +113,17 @@ python () {
             bb.fatal("%s contains conflicting IMAGE_FEATURES %s %s" % (d.getVar('PN', True), feature, ' '.join(list(temp))))
 
     d.setVar('IMAGE_FEATURES', ' '.join(list(remain_features)))
+
+    # Ensure we have the vendor list for complementary package handling
+    ml_vendor_list = ""
+    multilibs = d.getVar('MULTILIBS', True) or ""
+    for ext in multilibs.split():
+        eext = ext.split(':')
+        if len(eext) > 1 and eext[0] == 'multilib':
+            localdata = bb.data.createCopy(d)
+            vendor = localdata.getVar("TARGET_VENDOR_virtclass-multilib-" + eext[1], False)
+            ml_vendor_list += " " + vendor
+    d.setVar('MULTILIB_VENDORS', ml_vendor_list)
 }
 
 python image_handler () {
@@ -357,7 +368,10 @@ rootfs_install_complementary() {
 
     if [ "$GLOBS" != "" ] ; then
         # Use the magic script to do all the work for us :)
-        oe-pkgdata-util glob ${TMPDIR}/pkgdata ${TARGET_VENDOR}-${TARGET_OS} ${WORKDIR}/installed_pkgs.txt "$GLOBS" > ${WORKDIR}/complementary_pkgs.txt
+        : > ${WORKDIR}/complementary_pkgs.txt
+        for vendor in ${TARGET_VENDOR} ${MULTILIB_VENDORS} ; do
+            oe-pkgdata-util glob ${TMPDIR}/pkgdata $vendor-${TARGET_OS} ${WORKDIR}/installed_pkgs.txt "$GLOBS" >> ${WORKDIR}/complementary_pkgs.txt
+        done
 
         # Install the packages, if any
         sed -i '/^$/d' ${WORKDIR}/complementary_pkgs.txt
meta/classes/package_rpm.bbclass +4 -1
index a00b702..05108b2 100644
@@ -99,8 +99,11 @@ translate_smart_to_oe() {
 				if [ "$arch" = "$cmp_arch" -o "$fixed_arch" = "$cmp_arch" ]; then
 					if [ "$mlib" = "default" ]; then
 						new_pkg="$pkg"
+						new_arch=$cmp_arch
 					else
 						new_pkg="$mlib-$pkg"
+						# We need to strip off the ${mlib}_ prefix on the arch
+						new_arch=${cmp_arch#${mlib}_}
 					fi
 					# Workaround for bug 3565
 					# Simply look to see if we know of a package with that name, if not try again!
@@ -121,7 +124,7 @@ translate_smart_to_oe() {
 
 		#echo "$pkg -> $new_pkg" >&2
 		if [ "$arg1" = "arch" ]; then
-			echo $new_pkg $cmp_arch $other
+			echo $new_pkg $new_arch $other
 		else
 			echo $new_pkg $other
 		fi
Signature · 1 line
1.7.3.4
author
#2 lore raw

PATCH 2/2 package_rpm.bbclass: Refactor the attempt only install

In reply to Mark Hatle

Smart does not have a method to perform an install, but ignore failures.

There was a class of failures that stopped Smart from processing attemptonly installs. To work around this we need to iterate over the to be attempted list.

---
 meta/classes/package_rpm.bbclass |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
meta/classes/package_rpm.bbclass +6 -2
index 05108b2..dc8a54e 100644
@@ -465,10 +465,14 @@ EOF
 
 	if [ -n "${package_attemptonly}" ]; then
 		echo "Note: installing attempt only packages..."
+		echo "Attempting $pkgs_to_install"
 		echo "Note: see `dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}"
 		translate_oe_to_smart ${sdk_mode} --attemptonly $package_attemptonly
-		echo "Attempting $pkgs_to_install"
-		smart --data-dir=${target_rootfs}/var/lib/smart install -y $pkgs_to_install >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1 || true
+		for each_pkg in $pkgs_to_install ;  do
+			# We need to try each package individually as a single dependency failure
+			# will break the whole set otherwise.
+			smart --data-dir=${target_rootfs}/var/lib/smart install -y $each_pkg >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1 || true
+		done
 	fi
 }
 
Signature · 1 line
1.7.3.4