summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2011-09-22 03:06:52 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-22 01:20:18 +0100
commit97bded5bc4ae043e9e5ccf5ddf93542731165351 (patch)
treea9a5e79008ddd772fbbf4a536564e06af726123f /meta
parentbcfff457f63f43f53bcaf04f116e09bb2bba9bd6 (diff)
downloadpoky-97bded5bc4ae043e9e5ccf5ddf93542731165351.tar.gz
rootfs_rpm: two step installation
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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/package_rpm.bbclass54
1 files changed, 50 insertions, 4 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index d822b545fc..775d525033 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -166,7 +166,8 @@ package_install_internal_rpm () {
166 local platform="${INSTALL_PLATFORM_RPM}" 166 local platform="${INSTALL_PLATFORM_RPM}"
167 local platform_extra="${INSTALL_PLATFORM_EXTRA_RPM}" 167 local platform_extra="${INSTALL_PLATFORM_EXTRA_RPM}"
168 local confbase="${INSTALL_CONFBASE_RPM}" 168 local confbase="${INSTALL_CONFBASE_RPM}"
169 local package_to_install="${INSTALL_PACKAGES_NORMAL_RPM} ${INSTALL_PACKAGES_MULTILIB_RPM}" 169 local package_to_install="${INSTALL_PACKAGES_NORMAL_RPM}"
170 local multilib_to_install="${INSTALL_PACKAGES_MULTILIB_RPM}"
170 local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_RPM}" 171 local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_RPM}"
171 local package_linguas="${INSTALL_PACKAGES_LINGUAS_RPM}" 172 local package_linguas="${INSTALL_PACKAGES_LINGUAS_RPM}"
172 local providename="${INSTALL_PROVIDENAME_RPM}" 173 local providename="${INSTALL_PROVIDENAME_RPM}"
@@ -253,11 +254,13 @@ package_install_internal_rpm () {
253 done 254 done
254 fi 255 fi
255 256
257 # Normal package installation
258
256 # Generate an install solution by doing a --justdb install, then recreate it with 259 # Generate an install solution by doing a --justdb install, then recreate it with
257 # an actual package install! 260 # an actual package install!
258 ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \ 261 ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
259 --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \ 262 --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
260 -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \ 263 -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-base_archs.macro`" \
261 -D "__dbi_txn create nofsync" \ 264 -D "__dbi_txn create nofsync" \
262 -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \ 265 -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
263 ${target_rootfs}/install/install.manifest 266 ${target_rootfs}/install/install.manifest
@@ -351,14 +354,57 @@ package_install_internal_rpm () {
351 -D "__dbi_txn create nofsync private" \ 354 -D "__dbi_txn create nofsync private" \
352 | grep -i 'Packageorigin' | cut -d : -f 2 > ${target_rootfs}/install/install_solution.manifest 355 | grep -i 'Packageorigin' | cut -d : -f 2 > ${target_rootfs}/install/install_solution.manifest
353 356
357 if [ ! -z "${multilib_to_install}" ]; then
358 for pkg in ${multilib_to_install} ; do
359 echo "Processing $pkg..."
360
361 archvar=base_archs
362 ml_prefix=`echo ${pkg} | cut -d'-' -f1`
363 ml_pkg=$pkg
364 for i in ${MULTILIB_PREFIX_LIST} ; do
365 if [ ${ml_prefix} == ${i} ]; then
366 ml_pkg=$(echo ${pkg} | sed "s,^${ml_prefix}-\(.*\),\1,")
367 archvar=ml_archs
368 break
369 fi
370 done
371
372 pkg_name=$(resolve_package_rpm ${confbase}-${archvar}.conf ${ml_pkg})
373 if [ -z "$pkg_name" ]; then
374 echo "Unable to find package $pkg ($ml_pkg)!"
375 exit 1
376 fi
377 echo $pkg_name >> ${target_rootfs}/install/install_multilib.manifest
378 done
379 fi
380
381 # multilib package installation
382
383 # Generate an install solution by doing a --justdb install, then recreate it with
384 # an actual package install!
385 ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
386 --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
387 -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-ml_archs.macro`" \
388 -D "__dbi_txn create nofsync" \
389 -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
390 ${target_rootfs}/install/install_multilib.manifest
391
392 # Now that we have a solution, pull out a list of what to install...
393 echo "Manifest: ${target_rootfs}/install/install_multilib.manifest"
394 ${RPM} -D "_dbpath ${target_rootfs}/install" -qa --yaml \
395 -D "__dbi_txn create nofsync private" \
396 | grep -i 'Packageorigin' | cut -d : -f 2 > ${target_rootfs}/install/install_multilib_solution.manifest
397
398
354 # Attempt install 399 # Attempt install
355 ${RPM} --root ${target_rootfs} \ 400 ${RPM} --root ${target_rootfs} \
356 --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \ 401 --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
357 --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \ 402 --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
358 -D "_dbpath ${rpmlibdir}" \ 403 -D "_dbpath ${rpmlibdir}" \
359 --noscripts --notriggers --noparentdirs --nolinktos \ 404 --noscripts --notriggers --noparentdirs --nolinktos --replacepkgs \
360 -D "__dbi_txn create nofsync private" \ 405 -D "__dbi_txn create nofsync private" \
361 -Uhv ${target_rootfs}/install/install_solution.manifest 406 -Uhv ${target_rootfs}/install/install_solution.manifest \
407 ${target_rootfs}/install/install_multilib_solution.manifest
362} 408}
363 409
364python write_specfile () { 410python write_specfile () {