summaryrefslogtreecommitdiff
path: root/meta/classes/rootfs_ipk.bbclass
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2013-05-21 14:17:19 +0300
committerSaul Wold <sgw@linux.intel.com>2013-06-10 14:51:28 -0700
commit928df79cd3964f775c4c6e4283ef84b8882f9328 (patch)
tree93a033332f6d501462b39aa6fa065851bb1da623 /meta/classes/rootfs_ipk.bbclass
parent5330905749828ea8befdee559c180754ac506b75 (diff)
downloadopenembedded-core-928df79cd3964f775c4c6e4283ef84b8882f9328.tar.gz
openembedded-core-928df79cd3964f775c4c6e4283ef84b8882f9328.tar.bz2
openembedded-core-928df79cd3964f775c4c6e4283ef84b8882f9328.zip
rootfs_*.bbclass: add some helper functions
This patch adds the following helper functions: * delayed_postinsts - outputs the list of delayed postinstalls; * save_postinsts - this will save the delayed postinstalls for ipk/deb in /etc/(ipk|deb)_postinsts; * rootfs_remove_packages - removes packages from an image; Additionaly, this patch will remove a piece of code in rootfs_ipk_do_rootfs which will be moved to image.bbclass and used for all backends; [YOCTO #4484] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/rootfs_ipk.bbclass')
-rw-r--r--meta/classes/rootfs_ipk.bbclass39
1 files changed, 18 insertions, 21 deletions
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 3e1f9590fc..1403422ca7 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -91,36 +91,29 @@ fakeroot rootfs_ipk_do_rootfs () {
${ROOTFS_POSTPROCESS_COMMAND}
if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
- if grep Status:.install.ok.unpacked ${STATUS}; then
+ if [ -n "$(delayed_postinsts)" ]; then
bberror "Some packages could not be configured offline and rootfs is read-only."
exit 1
fi
fi
rm -f ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/lists/*
- if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
- if ! grep Status:.install.ok.unpacked ${STATUS}; then
- # All packages were successfully configured.
- # update-rc.d, base-passwd, run-postinsts are no further use, remove them now
- remove_run_postinsts=false
- if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
- remove_run_postinsts=true
- fi
- opkg-cl ${OPKG_ARGS} --force-depends remove update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL} || true
-
- # Need to remove rc.d files for run-postinsts by hand since opkg won't
- # call postrm scripts in offline root mode.
- if $remove_run_postinsts; then
- update-rc.d -f -r ${IMAGE_ROOTFS} run-postinsts remove
- fi
-
- # Also delete the status files
- remove_packaging_data_files
- fi
- fi
log_check rootfs
}
+rootfs_ipk_do_rootfs[vardeps] += "delayed_postinsts"
+
+delayed_postinsts () {
+ cat ${STATUS}|grep -e "^Package:" -e "^Status:"|sed -ne 'N;s/Package: \(.*\)\nStatus:.*unpacked/\1/p'
+}
+
+save_postinsts () {
+ for p in $(delayed_postinsts); do
+ install -d ${IMAGE_ROOTFS}${sysconfdir}/ipk-postinsts
+ cp ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/info/$p.postinst ${IMAGE_ROOTFS}${sysconfdir}/ipk-postinsts/$p
+ done
+}
+
rootfs_ipk_write_manifest() {
manifest=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest
cp ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/status $manifest
@@ -145,6 +138,10 @@ rootfs_install_packages() {
opkg-cl ${OPKG_ARGS} install `cat $1`
}
+rootfs_remove_packages() {
+ opkg-cl ${OPKG_ARGS} --force-depends remove $@
+}
+
ipk_insert_feed_uris () {
echo "Building from feeds activated!"