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>
This commit is contained in:
Paul Eggleton
2012-07-09 14:15:08 +01:00
committed by Richard Purdie
parent a73c25d2de
commit fa5640d143
10 changed files with 388 additions and 109 deletions

View File

@@ -248,6 +248,7 @@ process_pkg_list_rpm() {
# INSTALL_PACKAGES_LINGUAS_RPM - additional packages for uclibc
# INSTALL_PROVIDENAME_RPM - content for provide name
# INSTALL_TASK_RPM - task name
# INSTALL_COMPLEMENTARY_RPM - 1 to enable complementary package install mode
package_install_internal_rpm () {
@@ -261,31 +262,35 @@ package_install_internal_rpm () {
local providename="${INSTALL_PROVIDENAME_RPM}"
local task="${INSTALL_TASK_RPM}"
# Setup base system configuration
mkdir -p ${target_rootfs}/etc/rpm/
echo "${platform}${TARGET_VENDOR}-${TARGET_OS}" > ${target_rootfs}/etc/rpm/platform
if [ ! -z "$platform_extra" ]; then
for pt in $platform_extra ; do
case $pt in
noarch | any | all)
os="`echo ${TARGET_OS} | sed "s,-.*,,"`.*"
;;
*)
os="${TARGET_OS}"
;;
esac
echo "$pt-.*-$os" >> ${target_rootfs}/etc/rpm/platform
done
fi
if [ "${INSTALL_COMPLEMENTARY_RPM}" != "1" ] ; then
# Setup base system configuration
mkdir -p ${target_rootfs}/etc/rpm/
echo "${platform}${TARGET_VENDOR}-${TARGET_OS}" > ${target_rootfs}/etc/rpm/platform
if [ ! -z "$platform_extra" ]; then
for pt in $platform_extra ; do
case $pt in
noarch | any | all)
os="`echo ${TARGET_OS} | sed "s,-.*,,"`.*"
;;
*)
os="${TARGET_OS}"
;;
esac
echo "$pt-.*-$os" >> ${target_rootfs}/etc/rpm/platform
done
fi
# Tell RPM that the "/" directory exist and is available
mkdir -p ${target_rootfs}/etc/rpm/sysinfo
echo "/" >${target_rootfs}/etc/rpm/sysinfo/Dirnames
if [ ! -z "$providename" ]; then
cat /dev/null > ${target_rootfs}/etc/rpm/sysinfo/Providename
for provide in $providename ; do
echo $provide >> ${target_rootfs}/etc/rpm/sysinfo/Providename
done
# Tell RPM that the "/" directory exist and is available
mkdir -p ${target_rootfs}/etc/rpm/sysinfo
echo "/" >${target_rootfs}/etc/rpm/sysinfo/Dirnames
if [ ! -z "$providename" ]; then
cat /dev/null > ${target_rootfs}/etc/rpm/sysinfo/Providename
for provide in $providename ; do
echo $provide >> ${target_rootfs}/etc/rpm/sysinfo/Providename
done
fi
else
mv ${target_rootfs}/install/total_solution.manifest ${target_rootfs}/install/original_solution.manifest
fi
# Setup manifest of packages to install...
@@ -480,13 +485,22 @@ mutex_set_max 163840
# ================ Replication
EOF
# RPM is special. It can't handle dependencies and preinstall scripts correctly. Its
# probably a feature. The only way to convince rpm to actually run the preinstall scripts
# for base-passwd and shadow first before installing packages that depend on these packages
# is to do two image installs, installing one set of packages, then the other.
if [ "${INC_RPM_IMAGE_GEN}" = "1" -a -f "$pre_btmanifest" ]; then
echo "Skipping pre install due to exisitng image"
if [ "${INSTALL_COMPLEMENTARY_RPM}" = "1" ] ; then
# Only install packages not already installed (dependency calculation will
# almost certainly have added some that have been)
sort ${target_rootfs}/install/original_solution.manifest > ${target_rootfs}/install/original_solution_sorted.manifest
sort ${target_rootfs}/install/total_solution.manifest > ${target_rootfs}/install/total_solution_sorted.manifest
comm -2 -3 ${target_rootfs}/install/total_solution_sorted.manifest \
${target_rootfs}/install/original_solution_sorted.manifest | awk '{print $1}' > \
${target_rootfs}/install/diff.manifest
mv ${target_rootfs}/install/diff.manifest ${target_rootfs}/install/total_solution.manifest
elif [ "${INC_RPM_IMAGE_GEN}" = "1" -a -f "$pre_btmanifest" ]; then
echo "Skipping pre install due to existing image"
else
# RPM is special. It can't handle dependencies and preinstall scripts correctly. Its
# probably a feature. The only way to convince rpm to actually run the preinstall scripts
# for base-passwd and shadow first before installing packages that depend on these packages
# is to do two image installs, installing one set of packages, then the other.
rm -f ${target_rootfs}/install/initial_install.manifest
echo "Installing base dependencies first (base-passwd, base-files and shadow) since rpm is special"
grep /base-passwd-[0-9] ${target_rootfs}/install/total_solution.manifest >> ${target_rootfs}/install/initial_install.manifest || true