Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1][PULL] multilib: two step of rpm rootfs installation.
@ 2011-09-21 19:06 Dongxiao Xu
  2011-09-21 19:06 ` [PATCH 1/1] rootfs_rpm: two step installation Dongxiao Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Dongxiao Xu @ 2011-09-21 19:06 UTC (permalink / raw)
  To: openembedded-core

Hi Richard and Saul,

This pull request implement the two step of rpm rootfs installation,
please help to review and pull.

Thanks,
Dongxiao

The following changes since commit bcfff457f63f43f53bcaf04f116e09bb2bba9bd6:

  Fix mercurial fetcher in fetch2 (2011-09-21 14:07:31 +0100)

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

Dongxiao Xu (1):
  rootfs_rpm: two step installation

 meta/classes/package_rpm.bbclass |   54 +++++++++++++++++++++++++++++++++++---
 1 files changed, 50 insertions(+), 4 deletions(-)




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] rootfs_rpm: two step installation
  2011-09-21 19:06 [PATCH 0/1][PULL] multilib: two step of rpm rootfs installation Dongxiao Xu
@ 2011-09-21 19:06 ` Dongxiao Xu
  2011-09-21 19:24   ` Mark Hatle
  2011-09-22  0:38   ` Richard Purdie
  0 siblings, 2 replies; 4+ messages in thread
From: Dongxiao Xu @ 2011-09-21 19:06 UTC (permalink / raw)
  To: openembedded-core

Firstly we install a base image.
Then install those multilib packages listed in MULTILIB_IMAGE_INSTALL.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 meta/classes/package_rpm.bbclass |   54 +++++++++++++++++++++++++++++++++++---
 1 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index d822b54..775d525 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -166,7 +166,8 @@ 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} ${INSTALL_PACKAGES_MULTILIB_RPM}"
+	local package_to_install="${INSTALL_PACKAGES_NORMAL_RPM}"
+	local multilib_to_install="${INSTALL_PACKAGES_MULTILIB_RPM}"
 	local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_RPM}"
 	local package_linguas="${INSTALL_PACKAGES_LINGUAS_RPM}"
 	local providename="${INSTALL_PROVIDENAME_RPM}"
@@ -253,11 +254,13 @@ package_install_internal_rpm () {
 		done
 	fi
 
+	# Normal package installation
+
 	# Generate an install solution by doing a --justdb install, then recreate it with
 	# an actual package install!
 	${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
 		--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
-		-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \
+		-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-base_archs.macro`" \
 		-D "__dbi_txn create nofsync" \
 		-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
 		${target_rootfs}/install/install.manifest
@@ -351,14 +354,57 @@ package_install_internal_rpm () {
 		-D "__dbi_txn create nofsync private" \
 		| grep -i 'Packageorigin' | cut -d : -f 2 > ${target_rootfs}/install/install_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
+	fi
+
+	# multilib package installation
+
+	# Generate an install solution by doing a --justdb install, then recreate it with
+	# an actual package install!
+	${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
+		--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
+		-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-ml_archs.macro`" \
+		-D "__dbi_txn create nofsync" \
+		-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
+		${target_rootfs}/install/install_multilib.manifest
+
+	# Now that we have a solution, pull out a list of what to install...
+	echo "Manifest: ${target_rootfs}/install/install_multilib.manifest"
+	${RPM} -D "_dbpath ${target_rootfs}/install" -qa --yaml \
+		-D "__dbi_txn create nofsync private" \
+		| grep -i 'Packageorigin' | cut -d : -f 2 > ${target_rootfs}/install/install_multilib_solution.manifest
+
+
 	# Attempt install
 	${RPM} --root ${target_rootfs} \
 		--predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
 		--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
 		-D "_dbpath ${rpmlibdir}" \
-		--noscripts --notriggers --noparentdirs --nolinktos \
+		--noscripts --notriggers --noparentdirs --nolinktos --replacepkgs \
 		-D "__dbi_txn create nofsync private" \
-		-Uhv ${target_rootfs}/install/install_solution.manifest
+		-Uhv ${target_rootfs}/install/install_solution.manifest \
+		${target_rootfs}/install/install_multilib_solution.manifest
 }
 
 python write_specfile () {
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] rootfs_rpm: two step installation
  2011-09-21 19:06 ` [PATCH 1/1] rootfs_rpm: two step installation Dongxiao Xu
@ 2011-09-21 19:24   ` Mark Hatle
  2011-09-22  0:38   ` Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Hatle @ 2011-09-21 19:24 UTC (permalink / raw)
  To: openembedded-core

On 9/21/11 2:06 PM, Dongxiao Xu wrote:
> Firstly we install a base image.
> Then install those multilib packages listed in MULTILIB_IMAGE_INSTALL.
> 
> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>

I worked with Dongxiao on this solution.

Acked-by: Mark Hatle <mark.hatle@windriver.com>

> ---
>  meta/classes/package_rpm.bbclass |   54 +++++++++++++++++++++++++++++++++++---
>  1 files changed, 50 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
> index d822b54..775d525 100644
> --- a/meta/classes/package_rpm.bbclass
> +++ b/meta/classes/package_rpm.bbclass
> @@ -166,7 +166,8 @@ 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} ${INSTALL_PACKAGES_MULTILIB_RPM}"
> +	local package_to_install="${INSTALL_PACKAGES_NORMAL_RPM}"
> +	local multilib_to_install="${INSTALL_PACKAGES_MULTILIB_RPM}"
>  	local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_RPM}"
>  	local package_linguas="${INSTALL_PACKAGES_LINGUAS_RPM}"
>  	local providename="${INSTALL_PROVIDENAME_RPM}"
> @@ -253,11 +254,13 @@ package_install_internal_rpm () {
>  		done
>  	fi
>  
> +	# Normal package installation
> +
>  	# Generate an install solution by doing a --justdb install, then recreate it with
>  	# an actual package install!
>  	${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
>  		--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
> -		-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \
> +		-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-base_archs.macro`" \
>  		-D "__dbi_txn create nofsync" \
>  		-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
>  		${target_rootfs}/install/install.manifest
> @@ -351,14 +354,57 @@ package_install_internal_rpm () {
>  		-D "__dbi_txn create nofsync private" \
>  		| grep -i 'Packageorigin' | cut -d : -f 2 > ${target_rootfs}/install/install_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
> +	fi
> +
> +	# multilib package installation
> +
> +	# Generate an install solution by doing a --justdb install, then recreate it with
> +	# an actual package install!
> +	${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
> +		--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
> +		-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-ml_archs.macro`" \
> +		-D "__dbi_txn create nofsync" \
> +		-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
> +		${target_rootfs}/install/install_multilib.manifest
> +
> +	# Now that we have a solution, pull out a list of what to install...
> +	echo "Manifest: ${target_rootfs}/install/install_multilib.manifest"
> +	${RPM} -D "_dbpath ${target_rootfs}/install" -qa --yaml \
> +		-D "__dbi_txn create nofsync private" \
> +		| grep -i 'Packageorigin' | cut -d : -f 2 > ${target_rootfs}/install/install_multilib_solution.manifest
> +
> +
>  	# Attempt install
>  	${RPM} --root ${target_rootfs} \
>  		--predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
>  		--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
>  		-D "_dbpath ${rpmlibdir}" \
> -		--noscripts --notriggers --noparentdirs --nolinktos \
> +		--noscripts --notriggers --noparentdirs --nolinktos --replacepkgs \
>  		-D "__dbi_txn create nofsync private" \
> -		-Uhv ${target_rootfs}/install/install_solution.manifest
> +		-Uhv ${target_rootfs}/install/install_solution.manifest \
> +		${target_rootfs}/install/install_multilib_solution.manifest
>  }
>  
>  python write_specfile () {




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] rootfs_rpm: two step installation
  2011-09-21 19:06 ` [PATCH 1/1] rootfs_rpm: two step installation Dongxiao Xu
  2011-09-21 19:24   ` Mark Hatle
@ 2011-09-22  0:38   ` Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2011-09-22  0:38 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Thu, 2011-09-22 at 03:06 +0800, Dongxiao Xu wrote:
> Firstly we install a base image.
> Then install those multilib packages listed in MULTILIB_IMAGE_INSTALL.
> 
> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
> ---
>  meta/classes/package_rpm.bbclass |   54 +++++++++++++++++++++++++++++++++++---
>  1 files changed, 50 insertions(+), 4 deletions(-)

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-22  0:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-21 19:06 [PATCH 0/1][PULL] multilib: two step of rpm rootfs installation Dongxiao Xu
2011-09-21 19:06 ` [PATCH 1/1] rootfs_rpm: two step installation Dongxiao Xu
2011-09-21 19:24   ` Mark Hatle
2011-09-22  0:38   ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox