diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-07-09 14:15:08 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-28 11:13:51 +0100 |
commit | 72d1048a8381fa4a8c4c0d082047536727b4be47 (patch) | |
tree | b8627cf178fca43ff7b2c0e73ecd26d06cd7d8ca /meta/classes/rootfs_rpm.bbclass | |
parent | 9135d351ba7cb21e50239d2b310565680bd4fdca (diff) | |
download | openembedded-core-72d1048a8381fa4a8c4c0d082047536727b4be47.tar.gz openembedded-core-72d1048a8381fa4a8c4c0d082047536727b4be47.tar.bz2 openembedded-core-72d1048a8381fa4a8c4c0d082047536727b4be47.zip |
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].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta/classes/rootfs_rpm.bbclass')
-rw-r--r-- | meta/classes/rootfs_rpm.bbclass | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index cd9c5ab778..1cc4a84495 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass @@ -22,7 +22,7 @@ do_rootfs[depends] += "opkg-native:do_populate_sysroot" do_rootfs[recrdeptask] += "do_package_write_rpm" RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; " -RPM_POSTPROCESS_COMMANDS = "rootfs_install_all_locales; " +RPM_POSTPROCESS_COMMANDS = "" # # Allow distributions to alter when [postponed] package install scripts are run @@ -56,6 +56,7 @@ fakeroot rootfs_rpm_do_rootfs () { export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}" export INSTALL_PROVIDENAME_RPM="" export INSTALL_TASK_RPM="rootfs_rpm_do_rootfs" + export INSTALL_COMPLEMENTARY_RPM="" # Setup base system configuration mkdir -p ${INSTALL_ROOTFS_RPM}/etc/rpm/ @@ -69,6 +70,8 @@ fakeroot rootfs_rpm_do_rootfs () { package_install_internal_rpm + rootfs_install_complementary + export D=${IMAGE_ROOTFS} export OFFLINE_ROOT=${IMAGE_ROOTFS} export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} @@ -134,11 +137,15 @@ remove_packaging_data_files() { rm -rf ${IMAGE_ROOTFS}${opkglibdir} } -RPM_QUERY_CMD = '${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \ +RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}" \ -D "__dbi_txn create nofsync private"' list_installed_packages() { - ${RPM_QUERY_CMD} -qa --qf "[%{NAME}\n]" + if [ "$1" = "arch" ] ; then + ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" + else + ${RPM_QUERY_CMD} -qa --qf "[%{NAME}\n]" + fi } get_package_filename() { @@ -172,21 +179,15 @@ list_package_recommends() { ${RPM_QUERY_CMD} -q --suggests $1 } -rootfs_check_package_exists() { - resolve_package_rpm ${RPMCONF_TARGET_BASE}-base_archs.conf $1 -} - rootfs_install_packages() { - # The pkg to be installed here is not controlled by the - # package_install_internal_rpm, so it may have already been - # installed(e.g, installed in the first time when generate the - # rootfs), use '--replacepkgs' to always install them - for pkg in $@; do - ${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \ - -D "__dbi_txn create nofsync private" \ - --noscripts --notriggers --noparentdirs --nolinktos \ - --replacepkgs -Uhv $pkg || true - done + # Note - we expect the variables not set here to already have been set + export INSTALL_PACKAGES_RPM="" + export INSTALL_PACKAGES_ATTEMPTONLY_RPM="`cat $1`" + export INSTALL_PROVIDENAME_RPM="" + export INSTALL_TASK_RPM="rootfs_install_packages" + export INSTALL_COMPLEMENTARY_RPM="1" + + package_install_internal_rpm } python () { |