summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_ipk.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_ipk.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_ipk.bbclass')
-rw-r--r--meta/classes/rootfs_ipk.bbclass26
1 files changed, 14 insertions, 12 deletions
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 9732385613..7df97a014b 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -15,10 +15,12 @@ do_rootfs[recrdeptask] += "do_package_write_ipk"
15do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock" 15do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
16 16
17IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} --force-overwrite" 17IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} --force-overwrite"
18# The _POST version also works when constructing the matching SDK
19IPKG_ARGS_POST = "-f ${IPKGCONF_TARGET} -o $INSTALL_ROOTFS_IPK --force-overwrite"
18 20
19OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf" 21OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf"
20 22
21OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris; rootfs_install_all_locales; " 23OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris; "
22 24
23opkglibdir = "${localstatedir}/lib/opkg" 25opkglibdir = "${localstatedir}/lib/opkg"
24 26
@@ -74,6 +76,8 @@ fakeroot rootfs_ipk_do_rootfs () {
74 #mkdir -p ${IMAGE_ROOTFS}/etc/opkg/ 76 #mkdir -p ${IMAGE_ROOTFS}/etc/opkg/
75 #grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/opkg/arch.conf 77 #grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/opkg/arch.conf
76 78
79 rootfs_install_complementary
80
77 ${OPKG_POSTPROCESS_COMMANDS} 81 ${OPKG_POSTPROCESS_COMMANDS}
78 ${ROOTFS_POSTINSTALL_COMMAND} 82 ${ROOTFS_POSTINSTALL_COMMAND}
79 83
@@ -125,12 +129,16 @@ remove_packaging_data_files() {
125} 129}
126 130
127list_installed_packages() { 131list_installed_packages() {
128 grep ^Package: ${IMAGE_ROOTFS}${opkglibdir}/status | sed "s/^Package: //" 132 if [ "$1" = "arch" ] ; then
133 opkg-cl ${IPKG_ARGS_POST} status | opkg-query-helper.py -a
134 else
135 opkg-cl ${IPKG_ARGS_POST} list_installed | awk '{ print $1 }'
136 fi
129} 137}
130 138
131get_package_filename() { 139get_package_filename() {
132 set +x 140 set +x
133 info=`opkg-cl ${IPKG_ARGS} info $1 | grep -B 7 -A 7 "^Status.* \(\(installed\)\|\(unpacked\)\)" || true` 141 info=`opkg-cl ${IPKG_ARGS_POST} info $1 | grep -B 7 -A 7 "^Status.* \(\(installed\)\|\(unpacked\)\)" || true`
134 name=`echo "${info}" | awk '/^Package/ {printf $2"_"}'` 142 name=`echo "${info}" | awk '/^Package/ {printf $2"_"}'`
135 name=$name`echo "${info}" | awk -F: '/^Version/ {printf $NF"_"}' | sed 's/^\s*//g'` 143 name=$name`echo "${info}" | awk -F: '/^Version/ {printf $NF"_"}' | sed 's/^\s*//g'`
136 name=$name`echo "${info}" | awk '/^Archi/ {print $2".ipk"}'` 144 name=$name`echo "${info}" | awk '/^Archi/ {print $2".ipk"}'`
@@ -145,21 +153,15 @@ get_package_filename() {
145} 153}
146 154
147list_package_depends() { 155list_package_depends() {
148 opkg-cl ${IPKG_ARGS} info $1 | grep ^Depends | sed -e 's/^Depends: //' -e 's/,//g' -e 's:([=<>]* [^ )]*)::g' 156 opkg-cl ${IPKG_ARGS_POST} info $1 | grep ^Depends | sed -e 's/^Depends: //' -e 's/,//g' -e 's:([=<>]* [^ )]*)::g'
149} 157}
150 158
151list_package_recommends() { 159list_package_recommends() {
152 opkg-cl ${IPKG_ARGS} info $1 | grep ^Recommends | sed -e 's/^Recommends: //' -e 's/,//g' -e 's:([=<>]* [^ )]*)::g' 160 opkg-cl ${IPKG_ARGS_POST} info $1 | grep ^Recommends | sed -e 's/^Recommends: //' -e 's/,//g' -e 's:([=<>]* [^ )]*)::g'
153}
154
155rootfs_check_package_exists() {
156 if [ `opkg-cl ${IPKG_ARGS} info $1 | wc -l` -gt 2 ]; then
157 echo $1
158 fi
159} 161}
160 162
161rootfs_install_packages() { 163rootfs_install_packages() {
162 opkg-cl ${IPKG_ARGS} install $PACKAGES_TO_INSTALL 164 opkg-cl ${IPKG_ARGS_POST} install `cat $1`
163} 165}
164 166
165ipk_insert_feed_uris () { 167ipk_insert_feed_uris () {