summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2008-11-06 16:23:32 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2008-11-06 16:23:32 +0000
commit436c5f4716bae47bf9ddddfe0cbaf595a3de46c7 (patch)
treef4f9a76d581903d2b62f58b490996552ed47d9e4
parent1e967ea93ee425dfca6857ec958e9a55160133ac (diff)
downloadpoky-436c5f4716bae47bf9ddddfe0cbaf595a3de46c7.tar.gz
classes: Add mechanism to install packages into images only if they've been built
-rw-r--r--meta/classes/image.bbclass2
-rw-r--r--meta/classes/rootfs_deb.bbclass14
-rw-r--r--meta/classes/rootfs_ipk.bbclass4
-rw-r--r--meta/classes/rootfs_rpm.bbclass4
4 files changed, 21 insertions, 3 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 8407cdd567..35b7e12498 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -9,6 +9,7 @@ INHIBIT_DEFAULT_DEPS = "1"
9# "export IMAGE_BASENAME" not supported at this time 9# "export IMAGE_BASENAME" not supported at this time
10IMAGE_BASENAME[export] = "1" 10IMAGE_BASENAME[export] = "1"
11export PACKAGE_INSTALL ?= "${IMAGE_INSTALL}" 11export PACKAGE_INSTALL ?= "${IMAGE_INSTALL}"
12PACKAGE_INSTALL_ATTEMPTONLY ?= ""
12 13
13# We need to recursively follow RDEPENDS and RRECOMMENDS for images 14# We need to recursively follow RDEPENDS and RRECOMMENDS for images
14do_rootfs[recrdeptask] += "do_deploy do_populate_staging" 15do_rootfs[recrdeptask] += "do_deploy do_populate_staging"
@@ -36,6 +37,7 @@ python () {
36 bb.data.setVarFlag('do_rootfs', 'depends', deps, d) 37 bb.data.setVarFlag('do_rootfs', 'depends', deps, d)
37 38
38 runtime_mapping_rename("PACKAGE_INSTALL", d) 39 runtime_mapping_rename("PACKAGE_INSTALL", d)
40 runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", d)
39} 41}
40 42
41# 43#
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 55d2b920b6..411a6c4e71 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -81,12 +81,20 @@ fakeroot rootfs_deb_do_rootfs () {
81 if [ $? -ne 0 ]; then 81 if [ $? -ne 0 ]; then
82 exit 1 82 exit 1
83 fi 83 fi
84 find ${IMAGE_ROOTFS} -name \*.dpkg-new | for i in `cat`; do
85 mv $i `echo $i | sed -e's,\.dpkg-new$,,'`
86 done
87 done 84 done
88 fi 85 fi
89 86
87 rm ${WORKDIR}/temp/log.do_$target-attemptonly.${PID}
88 if [ ! -z "${PACKAGE_INSTALL_ATTEMPTONLY}" ]; then
89 for i in ${PACKAGE_INSTALL_ATTEMPTONLY}; do
90 apt-get install $i --force-yes --allow-unauthenticated >> ${WORKDIR}/temp/log.do_$target-attemptonly.${PID} || true
91 done
92 fi
93
94 find ${IMAGE_ROOTFS} -name \*.dpkg-new | for i in `cat`; do
95 mv $i `echo $i | sed -e's,\.dpkg-new$,,'`
96 done
97
90 install -d ${IMAGE_ROOTFS}/${sysconfdir} 98 install -d ${IMAGE_ROOTFS}/${sysconfdir}
91 echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version 99 echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
92 100
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index ce6dd797ec..07f418adbd 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -42,6 +42,10 @@ fakeroot rootfs_ipk_do_rootfs () {
42 opkg-cl ${IPKG_ARGS} install ${PACKAGE_INSTALL} 42 opkg-cl ${IPKG_ARGS} install ${PACKAGE_INSTALL}
43 fi 43 fi
44 44
45 if [ ! -z "${PACKAGE_INSTALL_ATTEMPTONLY}" ]; then
46 opkg-cl ${IPKG_ARGS} install ${PACKAGE_INSTALL_ATTEMPTONLY} > "${WORKDIR}/temp/log.do_rootfs_attemptonly.${PID}" || true
47 fi
48
45 export D=${IMAGE_ROOTFS} 49 export D=${IMAGE_ROOTFS}
46 export OFFLINE_ROOT=${IMAGE_ROOTFS} 50 export OFFLINE_ROOT=${IMAGE_ROOTFS}
47 export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} 51 export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index e3697cb12c..dcdd37c8ee 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -110,6 +110,10 @@ EOF
110 fakechroot yum ${YUMARGS} -y install ${PACKAGE_INSTALL} 110 fakechroot yum ${YUMARGS} -y install ${PACKAGE_INSTALL}
111 fi 111 fi
112 112
113 if [ ! -z "${PACKAGE_INSTALL_ATTEMPTONLY}" ]; then
114 fakechroot yum ${YUMARGS} -y install ${PACKAGE_INSTALL_ATTEMPTONLY} > ${WORKDIR}/temp/log.do_$target-attemptonly.${PID} || true
115 fi
116
113 # Add any recommended packages to the image 117 # Add any recommended packages to the image
114 # (added as an extra script since yum itself doesn't support this) 118 # (added as an extra script since yum itself doesn't support this)
115 yum-install-recommends.py ${IMAGE_ROOTFS} "fakechroot yum ${YUMARGS} -y install" 119 yum-install-recommends.py ${IMAGE_ROOTFS} "fakechroot yum ${YUMARGS} -y install"