summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-07-09 14:15:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-29 10:16:14 +0100
commitfa5640d143beea4be101d6622d3fa133d04272f2 (patch)
tree7ca77430c1531399bdde6caec441bae40ac69568 /meta/classes/package_rpm.bbclass
parenta73c25d2ded3a72159f2ce527e7307808c734686 (diff)
downloadpoky-fa5640d143beea4be101d6622d3fa133d04272f2.tar.gz
Rework installation of dev, dbg, doc, and locale packages
Use a similar mechanism that was previously used to install locales at rootfs generation time to install other "complementary" packages (e.g. *-dev packages) - i.e. install all of the explicitly requested packages and their dependencies, then get a list of the packages that were installed, and use that list to install the complementary packages. This has been implemented by using a list of globs which should make it easier to extend in future. The previous locale package installation code assumed that the locale packages did not have any dependencies that were not already installed; now that we are installing non-locale packages this is no longer correct. In practice only the rpm backend actually made use of this assumption, so it needed to be changed to call into the existing package backend code to do the complementary package installation rather than calling rpm directly. This fixes the doc-pkgs IMAGE_FEATURES feature to work correctly, and also ensures that all dev/dbg packages get installed for dev-pkgs/dbg-pkgs respectively even if the dependency chains between those packages was not ensuring that already. The code has also been adapted to work correctly with the new SDK-from-image functionality. To that end, an SDKIMAGE_FEATURES variable has been added to allow specifying what extra image features should go into the SDK (extra, because by virtue of installing all of the packages in the image into the target part of the SDK, we already include all of IMAGE_FEATURES) with a default value of "dev-pkgs dbg-pkgs". Fixes [YOCTO #2614]. (From OE-Core rev: 72d1048a8381fa4a8c4c0d082047536727b4be47) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass74
1 files changed, 44 insertions, 30 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 29018e9cca..b4bc52e69b 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -248,6 +248,7 @@ process_pkg_list_rpm() {
248# INSTALL_PACKAGES_LINGUAS_RPM - additional packages for uclibc 248# INSTALL_PACKAGES_LINGUAS_RPM - additional packages for uclibc
249# INSTALL_PROVIDENAME_RPM - content for provide name 249# INSTALL_PROVIDENAME_RPM - content for provide name
250# INSTALL_TASK_RPM - task name 250# INSTALL_TASK_RPM - task name
251# INSTALL_COMPLEMENTARY_RPM - 1 to enable complementary package install mode
251 252
252package_install_internal_rpm () { 253package_install_internal_rpm () {
253 254
@@ -261,31 +262,35 @@ package_install_internal_rpm () {
261 local providename="${INSTALL_PROVIDENAME_RPM}" 262 local providename="${INSTALL_PROVIDENAME_RPM}"
262 local task="${INSTALL_TASK_RPM}" 263 local task="${INSTALL_TASK_RPM}"
263 264
264 # Setup base system configuration 265 if [ "${INSTALL_COMPLEMENTARY_RPM}" != "1" ] ; then
265 mkdir -p ${target_rootfs}/etc/rpm/ 266 # Setup base system configuration
266 echo "${platform}${TARGET_VENDOR}-${TARGET_OS}" > ${target_rootfs}/etc/rpm/platform 267 mkdir -p ${target_rootfs}/etc/rpm/
267 if [ ! -z "$platform_extra" ]; then 268 echo "${platform}${TARGET_VENDOR}-${TARGET_OS}" > ${target_rootfs}/etc/rpm/platform
268 for pt in $platform_extra ; do 269 if [ ! -z "$platform_extra" ]; then
269 case $pt in 270 for pt in $platform_extra ; do
270 noarch | any | all) 271 case $pt in
271 os="`echo ${TARGET_OS} | sed "s,-.*,,"`.*" 272 noarch | any | all)
272 ;; 273 os="`echo ${TARGET_OS} | sed "s,-.*,,"`.*"
273 *) 274 ;;
274 os="${TARGET_OS}" 275 *)
275 ;; 276 os="${TARGET_OS}"
276 esac 277 ;;
277 echo "$pt-.*-$os" >> ${target_rootfs}/etc/rpm/platform 278 esac
278 done 279 echo "$pt-.*-$os" >> ${target_rootfs}/etc/rpm/platform
279 fi 280 done
281 fi
280 282
281 # Tell RPM that the "/" directory exist and is available 283 # Tell RPM that the "/" directory exist and is available
282 mkdir -p ${target_rootfs}/etc/rpm/sysinfo 284 mkdir -p ${target_rootfs}/etc/rpm/sysinfo
283 echo "/" >${target_rootfs}/etc/rpm/sysinfo/Dirnames 285 echo "/" >${target_rootfs}/etc/rpm/sysinfo/Dirnames
284 if [ ! -z "$providename" ]; then 286 if [ ! -z "$providename" ]; then
285 cat /dev/null > ${target_rootfs}/etc/rpm/sysinfo/Providename 287 cat /dev/null > ${target_rootfs}/etc/rpm/sysinfo/Providename
286 for provide in $providename ; do 288 for provide in $providename ; do
287 echo $provide >> ${target_rootfs}/etc/rpm/sysinfo/Providename 289 echo $provide >> ${target_rootfs}/etc/rpm/sysinfo/Providename
288 done 290 done
291 fi
292 else
293 mv ${target_rootfs}/install/total_solution.manifest ${target_rootfs}/install/original_solution.manifest
289 fi 294 fi
290 295
291 # Setup manifest of packages to install... 296 # Setup manifest of packages to install...
@@ -480,13 +485,22 @@ mutex_set_max 163840
480# ================ Replication 485# ================ Replication
481EOF 486EOF
482 487
483 # RPM is special. It can't handle dependencies and preinstall scripts correctly. Its 488 if [ "${INSTALL_COMPLEMENTARY_RPM}" = "1" ] ; then
484 # probably a feature. The only way to convince rpm to actually run the preinstall scripts 489 # Only install packages not already installed (dependency calculation will
485 # for base-passwd and shadow first before installing packages that depend on these packages 490 # almost certainly have added some that have been)
486 # is to do two image installs, installing one set of packages, then the other. 491 sort ${target_rootfs}/install/original_solution.manifest > ${target_rootfs}/install/original_solution_sorted.manifest
487 if [ "${INC_RPM_IMAGE_GEN}" = "1" -a -f "$pre_btmanifest" ]; then 492 sort ${target_rootfs}/install/total_solution.manifest > ${target_rootfs}/install/total_solution_sorted.manifest
488 echo "Skipping pre install due to exisitng image" 493 comm -2 -3 ${target_rootfs}/install/total_solution_sorted.manifest \
494 ${target_rootfs}/install/original_solution_sorted.manifest | awk '{print $1}' > \
495 ${target_rootfs}/install/diff.manifest
496 mv ${target_rootfs}/install/diff.manifest ${target_rootfs}/install/total_solution.manifest
497 elif [ "${INC_RPM_IMAGE_GEN}" = "1" -a -f "$pre_btmanifest" ]; then
498 echo "Skipping pre install due to existing image"
489 else 499 else
500 # RPM is special. It can't handle dependencies and preinstall scripts correctly. Its
501 # probably a feature. The only way to convince rpm to actually run the preinstall scripts
502 # for base-passwd and shadow first before installing packages that depend on these packages
503 # is to do two image installs, installing one set of packages, then the other.
490 rm -f ${target_rootfs}/install/initial_install.manifest 504 rm -f ${target_rootfs}/install/initial_install.manifest
491 echo "Installing base dependencies first (base-passwd, base-files and shadow) since rpm is special" 505 echo "Installing base dependencies first (base-passwd, base-files and shadow) since rpm is special"
492 grep /base-passwd-[0-9] ${target_rootfs}/install/total_solution.manifest >> ${target_rootfs}/install/initial_install.manifest || true 506 grep /base-passwd-[0-9] ${target_rootfs}/install/total_solution.manifest >> ${target_rootfs}/install/initial_install.manifest || true