summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_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/rootfs_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/rootfs_rpm.bbclass')
-rw-r--r--meta/classes/rootfs_rpm.bbclass35
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"
22do_rootfs[recrdeptask] += "do_package_write_rpm" 22do_rootfs[recrdeptask] += "do_package_write_rpm"
23 23
24RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; " 24RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; "
25RPM_POSTPROCESS_COMMANDS = "rootfs_install_all_locales; " 25RPM_POSTPROCESS_COMMANDS = ""
26 26
27# 27#
28# Allow distributions to alter when [postponed] package install scripts are run 28# Allow distributions to alter when [postponed] package install scripts are run
@@ -56,6 +56,7 @@ fakeroot rootfs_rpm_do_rootfs () {
56 export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}" 56 export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}"
57 export INSTALL_PROVIDENAME_RPM="" 57 export INSTALL_PROVIDENAME_RPM=""
58 export INSTALL_TASK_RPM="rootfs_rpm_do_rootfs" 58 export INSTALL_TASK_RPM="rootfs_rpm_do_rootfs"
59 export INSTALL_COMPLEMENTARY_RPM=""
59 60
60 # Setup base system configuration 61 # Setup base system configuration
61 mkdir -p ${INSTALL_ROOTFS_RPM}/etc/rpm/ 62 mkdir -p ${INSTALL_ROOTFS_RPM}/etc/rpm/
@@ -69,6 +70,8 @@ fakeroot rootfs_rpm_do_rootfs () {
69 70
70 package_install_internal_rpm 71 package_install_internal_rpm
71 72
73 rootfs_install_complementary
74
72 export D=${IMAGE_ROOTFS} 75 export D=${IMAGE_ROOTFS}
73 export OFFLINE_ROOT=${IMAGE_ROOTFS} 76 export OFFLINE_ROOT=${IMAGE_ROOTFS}
74 export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} 77 export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
@@ -134,11 +137,15 @@ remove_packaging_data_files() {
134 rm -rf ${IMAGE_ROOTFS}${opkglibdir} 137 rm -rf ${IMAGE_ROOTFS}${opkglibdir}
135} 138}
136 139
137RPM_QUERY_CMD = '${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \ 140RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}" \
138 -D "__dbi_txn create nofsync private"' 141 -D "__dbi_txn create nofsync private"'
139 142
140list_installed_packages() { 143list_installed_packages() {
141 ${RPM_QUERY_CMD} -qa --qf "[%{NAME}\n]" 144 if [ "$1" = "arch" ] ; then
145 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]"
146 else
147 ${RPM_QUERY_CMD} -qa --qf "[%{NAME}\n]"
148 fi
142} 149}
143 150
144get_package_filename() { 151get_package_filename() {
@@ -172,21 +179,15 @@ list_package_recommends() {
172 ${RPM_QUERY_CMD} -q --suggests $1 179 ${RPM_QUERY_CMD} -q --suggests $1
173} 180}
174 181
175rootfs_check_package_exists() {
176 resolve_package_rpm ${RPMCONF_TARGET_BASE}-base_archs.conf $1
177}
178
179rootfs_install_packages() { 182rootfs_install_packages() {
180 # The pkg to be installed here is not controlled by the 183 # Note - we expect the variables not set here to already have been set
181 # package_install_internal_rpm, so it may have already been 184 export INSTALL_PACKAGES_RPM=""
182 # installed(e.g, installed in the first time when generate the 185 export INSTALL_PACKAGES_ATTEMPTONLY_RPM="`cat $1`"
183 # rootfs), use '--replacepkgs' to always install them 186 export INSTALL_PROVIDENAME_RPM=""
184 for pkg in $@; do 187 export INSTALL_TASK_RPM="rootfs_install_packages"
185 ${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \ 188 export INSTALL_COMPLEMENTARY_RPM="1"
186 -D "__dbi_txn create nofsync private" \ 189
187 --noscripts --notriggers --noparentdirs --nolinktos \ 190 package_install_internal_rpm
188 --replacepkgs -Uhv $pkg || true
189 done
190} 191}
191 192
192python () { 193python () {