Skip to contentSkip to conversation

multilib: drop MULTILIB_IMAGE_INSTALL variable.

GIT PULL In review Dongxiao Xu 2 participants 4 messages Nov 8, 2011 – Nov 9, 2011

lore
Share & tools
lore
#0 lore raw

Hi Richard,

This pull request is to remove the MULTILIB_IMAGE_INSTALL variable, please help to review and pull.

I tested build and runtime with both rpm and ipk packaging for following scenarios:

1) lib64-core-image-sato on qemux86-64.
2) lib32-core-image-sato on qemux86.
3) lib32-core-image-sato on qemux86-64.
4) lib64-core-image-sato on qemux86 (buildable, but not runnable).
5) core-image-sato on qemux86-64 with lib32-connman.

Thanks,
Dongxiao

The following changes since commit 0809f98e995d3a2ce24ad25bade3dcd5154061fd:

lighttpd 1.4.29: rename index.html to avoid clashes with DL_DIR (2011-11-07 14:03:38 +0000)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib dxu4/multilib
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dxu4/multilib

Dongxiao Xu (1):
multilib: Drop MULTILIB_IMAGE_INSTALL

 meta/classes/image.bbclass       |    4 +---
 meta/classes/multilib.bbclass    |    5 ++---
 meta/classes/package_ipk.bbclass |   31 ++++++++++++++++++++++++++++---
 meta/classes/package_rpm.bbclass |   37 +++++++++----------------------------
 meta/classes/rootfs_ipk.bbclass  |    3 +--
 meta/classes/rootfs_rpm.bbclass  |    3 +--
 6 files changed, 42 insertions(+), 41 deletions(-)
#1 lore raw

PATCH 1/1 multilib: Drop MULTILIB_IMAGE_INSTALL

There should just be a single IMAGE_INSTALL variable. If the package backends need this split into different multilib components they should be responsible for doing this, not the user.

This commit removes the MULTILIB_IMAGE_INSTALL variable.

[YOCTO #1564]

---
 meta/classes/image.bbclass       |    4 +---
 meta/classes/multilib.bbclass    |    5 ++---
 meta/classes/package_ipk.bbclass |   31 ++++++++++++++++++++++++++++---
 meta/classes/package_rpm.bbclass |   37 +++++++++----------------------------
 meta/classes/rootfs_ipk.bbclass  |    3 +--
 meta/classes/rootfs_rpm.bbclass  |    3 +--
 6 files changed, 42 insertions(+), 41 deletions(-)
meta/classes/image.bbclass +1 -3
index 05f4331..48b78da 100644
@@ -5,8 +5,7 @@ inherit imagetest-${IMAGETEST}
 
 LICENSE = "MIT"
 PACKAGES = ""
-MULTILIB_IMAGE_INSTALL ?= ""
-RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${MULTILIB_IMAGE_INSTALL} ${NORMAL_FEATURE_INSTALL}"
+RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${NORMAL_FEATURE_INSTALL}"
 RRECOMMENDS += "${NORMAL_FEATURE_INSTALL_OPTIONAL}"
 
 INHIBIT_DEFAULT_DEPS = "1"
@@ -54,7 +53,6 @@ IMAGE_INSTALL ?= ""
 IMAGE_INSTALL[type] = "list"
 IMAGE_BASENAME[export] = "1"
 export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${FEATURE_INSTALL}"
-export MULTILIB_PACKAGE_INSTALL ?= "${MULTILIB_IMAGE_INSTALL}"
 PACKAGE_INSTALL_ATTEMPTONLY ?= "${FEATURE_INSTALL_OPTIONAL}"
 
 # Images are generally built explicitly, do not need to be part of world.
meta/classes/multilib.bbclass +2 -3
index 1aed2a9..6eb3bc3 100644
@@ -56,9 +56,8 @@ python __anonymous () {
         map_dependencies("PACKAGE_INSTALL", d)
         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", "")
+        pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True)
+        d.setVar("PACKAGE_INSTALL", pinstall)
         d.setVar("LINGUAS_INSTALL", "")
         # FIXME, we need to map this to something, not delete it!
         d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", "")
meta/classes/package_ipk.bbclass +28 -3
index c97e36e..d41b40d 100644
@@ -86,12 +86,34 @@ package_tryout_install_multilib_ipk() {
 		fi
 	done
 }
+
+split_multilib_packages() {
+	INSTALL_PACKAGES_NORMAL_IPK=""
+	INSTALL_PACKAGES_MULTILIB_IPK=""
+	for pkg in ${INSTALL_PACKAGES_IPK}; do
+		is_multilib=0
+		for item in ${MULTILIB_VARIANTS}; do
+			local pkgname_prefix="${item}-"
+			if [ ${pkg:0:${#pkgname_prefix}} == ${pkgname_prefix} ]; then
+				is_multilib=1
+				break
+			fi
+		done
+
+		if [ ${is_multilib} = 0 ]; then
+			INSTALL_PACKAGES_NORMAL_IPK="${INSTALL_PACKAGES_NORMAL_IPK} ${pkg}"
+		else
+			INSTALL_PACKAGES_MULTILIB_IPK="${INSTALL_PACKAGES_MULTILIB_IPK} ${pkg}"
+		fi
+	done
+}
+
 #
 # install a bunch of packages using opkg
 # the following shell variables needs to be set before calling this func:
 # INSTALL_ROOTFS_IPK - install root dir
 # INSTALL_CONF_IPK - configuration file
-# INSTALL_PACKAGES_NORMAL_IPK - packages to be installed
+# INSTALL_PACKAGES_IPK - packages to be installed
 # INSTALL_PACKAGES_ATTEMPTONLY_IPK - packages attemped to be installed only
 # INSTALL_PACKAGES_LINGUAS_IPK - additional packages for uclibc
 # INSTALL_TASK_IPK - task name
@@ -100,12 +122,15 @@ package_install_internal_ipk() {
 
 	local target_rootfs="${INSTALL_ROOTFS_IPK}"
 	local conffile="${INSTALL_CONF_IPK}"
-	local package_to_install="${INSTALL_PACKAGES_NORMAL_IPK}"
 	local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_IPK}"
 	local package_linguas="${INSTALL_PACKAGES_LINGUAS_IPK}"
-	local package_multilib="${INSTALL_PACKAGES_MULTILIB_IPK}"
 	local task="${INSTALL_TASK_IPK}"
 
+	split_multilib_packages
+
+	local package_to_install="${INSTALL_PACKAGES_NORMAL_IPK}"
+	local package_multilib="${INSTALL_PACKAGES_MULTILIB_IPK}"
+
 	mkdir -p ${target_rootfs}${localstatedir}/lib/opkg/
 
 	local ipkg_args="-f ${conffile} -o ${target_rootfs} --force-overwrite"
meta/classes/package_rpm.bbclass +9 -28
index 7f42583..df5a2db 100644
@@ -154,7 +154,7 @@ resolve_package_rpm () {
 # INSTALL_PLATFORM_RPM - main platform
 # INSTALL_PLATFORM_EXTRA_RPM - extra platform
 # INSTALL_CONFBASE_RPM - configuration file base name
-# INSTALL_PACKAGES_NORMAL_RPM - packages to be installed
+# INSTALL_PACKAGES_RPM - packages to be installed
 # INSTALL_PACKAGES_ATTEMPTONLY_RPM - packages attemped to be installed only
 # INSTALL_PACKAGES_LINGUAS_RPM - additional packages for uclibc
 # INSTALL_PROVIDENAME_RPM - content for provide name
@@ -166,8 +166,7 @@ package_install_internal_rpm () {
 	local platform="${INSTALL_PLATFORM_RPM}"
 	local platform_extra="${INSTALL_PLATFORM_EXTRA_RPM}"
 	local confbase="${INSTALL_CONFBASE_RPM}"
-	local package_to_install="${INSTALL_PACKAGES_NORMAL_RPM}"
-	local multilib_to_install="${INSTALL_PACKAGES_MULTILIB_RPM}"
+	local package_to_install="${INSTALL_PACKAGES_RPM}"
 	local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_RPM}"
 	local package_linguas="${INSTALL_PACKAGES_LINGUAS_RPM}"
 	local providename="${INSTALL_PROVIDENAME_RPM}"
@@ -211,12 +210,14 @@ package_install_internal_rpm () {
 				echo "Processing $pkg..."
 
 				archvar=base_archs
+				manifest=install.manifest
 				ml_prefix=`echo ${pkg} | cut -d'-' -f1`
 				ml_pkg=$pkg
 				for i in ${MULTILIB_PREFIX_LIST} ; do
 					if [ ${ml_prefix} == ${i} ]; then
 						ml_pkg=$(echo ${pkg} | sed "s,^${ml_prefix}-\(.*\),\1,")
 						archvar=ml_archs
+						manifest=install_multilib.manifest
 						break
 					fi
 				done
@@ -226,7 +227,7 @@ package_install_internal_rpm () {
 					echo "Unable to find package $pkg ($ml_pkg)!"
 					exit 1
 				fi
-				echo $pkg_name >> ${target_rootfs}/install/install.manifest
+				echo $pkg_name >> ${target_rootfs}/install/${manifest}
 			done
 		fi
 	fi
@@ -235,12 +236,14 @@ package_install_internal_rpm () {
 			echo "Processing $pkg..."
 
 			archvar=base_archs
+			manifest=install.manifest
 			ml_prefix=`echo ${pkg} | cut -d'-' -f1`
 			ml_pkg=$pkg
 			for i in ${MULTILIB_PREFIX_LIST} ; do
 				if [ ${ml_prefix} == ${i} ]; then
 					ml_pkg=$(echo ${pkg} | sed "s,^${ml_prefix}-\(.*\),\1,")
 					archvar=ml_archs
+					manifest=install_multilib.manifest
 					break
 				fi
 			done
@@ -250,7 +253,7 @@ package_install_internal_rpm () {
 				echo "Unable to find package $pkg ($ml_pkg)!"
 				exit 1
 			fi
-			echo $pkg_name >> ${target_rootfs}/install/install.manifest
+			echo $pkg_name >> ${target_rootfs}/install/${manifest}
 		done
 	fi
 
@@ -356,29 +359,7 @@ package_install_internal_rpm () {
 
 	touch ${target_rootfs}/install/install_multilib_solution.manifest
 
-	if [ ! -z "${multilib_to_install}" ]; then
-		for pkg in ${multilib_to_install} ; do
-			echo "Processing $pkg..."
-
-			archvar=base_archs
-			ml_prefix=`echo ${pkg} | cut -d'-' -f1`
-			ml_pkg=$pkg
-			for i in ${MULTILIB_PREFIX_LIST} ; do
-				if [ ${ml_prefix} == ${i} ]; then
-					ml_pkg=$(echo ${pkg} | sed "s,^${ml_prefix}-\(.*\),\1,")
-					archvar=ml_archs
-					break
-				fi
-			done
-
-			pkg_name=$(resolve_package_rpm ${confbase}-${archvar}.conf ${ml_pkg})
-			if [ -z "$pkg_name" ]; then
-				echo "Unable to find package $pkg ($ml_pkg)!"
-				exit 1
-			fi
-			echo $pkg_name >> ${target_rootfs}/install/install_multilib.manifest
-		done
-
+	if [ -e "${target_rootfs}/install/install_multilib.manifest" ]; then
 		# multilib package installation
 
 		# Generate an install solution by doing a --justdb install, then recreate it with
meta/classes/rootfs_ipk.bbclass +1 -2
index 3094c1a..ffc4a72 100644
@@ -58,8 +58,7 @@ fakeroot rootfs_ipk_do_rootfs () {
 
 	export INSTALL_ROOTFS_IPK="${IMAGE_ROOTFS}"
 	export INSTALL_CONF_IPK="${IPKGCONF_TARGET}"
-	export INSTALL_PACKAGES_NORMAL_IPK="${PACKAGE_INSTALL}"
-	export INSTALL_PACKAGES_MULTILIB_IPK="${MULTILIB_PACKAGE_INSTALL}"
+	export INSTALL_PACKAGES_IPK="${PACKAGE_INSTALL}"
 
 	package_install_internal_ipk
 
meta/classes/rootfs_rpm.bbclass +1 -2
index dd370b2..9f50764 100644
@@ -57,8 +57,7 @@ fakeroot rootfs_rpm_do_rootfs () {
 	export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}"
 	export INSTALL_PLATFORM_RPM="${TARGET_ARCH}"
 	export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}"
-	export INSTALL_PACKAGES_NORMAL_RPM="${PACKAGE_INSTALL}"
-	export INSTALL_PACKAGES_MULTILIB_RPM="${MULTILIB_PACKAGE_INSTALL}"
+	export INSTALL_PACKAGES_RPM="${PACKAGE_INSTALL}"
 	export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${PACKAGE_INSTALL_ATTEMPTONLY}"
 	export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}"
 	export INSTALL_PROVIDENAME_RPM=""
Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH 1/1] multilib: Drop MULTILIB_IMAGE_INSTALL

Quoted 9 lines · Dongxiao Xu

There should just be a single IMAGE_INSTALL variable. If the package backends need this split into different multilib components they should be responsible for doing this, not the user.

This commit removes the MULTILIB_IMAGE_INSTALL variable.

[YOCTO #1564]

Quoted 8 lines
---
 meta/classes/image.bbclass       |    4 +---
 meta/classes/multilib.bbclass    |    5 ++---
 meta/classes/package_ipk.bbclass |   31 ++++++++++++++++++++++++++++---
 meta/classes/package_rpm.bbclass |   37 +++++++++----------------------------
 meta/classes/rootfs_ipk.bbclass  |    3 +--
 meta/classes/rootfs_rpm.bbclass  |    3 +--
 6 files changed, 42 insertions(+), 41 deletions(-)

I'll take this as its a definite improvement over the current situation. I did however wonder what happens if we try something tri-arch e.g. i586, x86_64 and x32?

I get the feeling both package backends could really use some cleanup now we have the basics working and better abstraction of the code so we can loop over something like tri-arch (or more) easily...

Cheers,

Richard

#3 lore raw

Re: [PATCH 1/1] multilib: Drop MULTILIB_IMAGE_INSTALL

Hi Richard,

Quoted 28 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Richard Purdie
Sent: Tuesday, November 08, 2011 10:30 PM
To: Patches and discussions about the oe-core layer
Subject: Re: [OE-core] [PATCH 1/1] multilib: Drop MULTILIB_IMAGE_INSTALL

Quoted 6 lines · Dongxiao Xu

There should just be a single IMAGE_INSTALL variable. If the package backends need this split into different multilib components they should be responsible for doing this, not the user.

This commit removes the MULTILIB_IMAGE_INSTALL variable.

Quoted 7 lines

[YOCTO #1564]

---
 meta/classes/image.bbclass       |    4 +---
 meta/classes/multilib.bbclass    |    5 ++---
 meta/classes/package_ipk.bbclass |   31

++++++++++++++++++++++++++++---

Quoted 4 lines
 meta/classes/package_rpm.bbclass |   37 +++++++++----------------------------
 meta/classes/rootfs_ipk.bbclass  |    3 +--
 meta/classes/rootfs_rpm.bbclass  |    3 +--
 6 files changed, 42 insertions(+), 41 deletions(-)
Quoted 7 lines

I'll take this as its a definite improvement over the current situation. I did however wonder what happens if we try something tri-arch e.g. i586, x86_64 and x32?

I get the feeling both package backends could really use some cleanup now we have the basics working and better abstraction of the code so we can loop over something like tri-arch (or more) easily...

Thanks for merging it.

Currently the tri-arch multilib is not tested, and suppose there will be bugs inside.
As you said, we can take this into consideration when doing a whole cleanup for both rpm and ipk packaging.
Yes we do need that kind of cleanup since different people have different thinking logic and coding style. For multilib it is better to unify them.

Thanks,
Dongxiao

Quoted 10 lines

Cheers,

Richard

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core