summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
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