summaryrefslogtreecommitdiff
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2013-05-21 14:27:49 +0300
committerSaul Wold <sgw@linux.intel.com>2013-06-10 14:51:29 -0700
commitd3d810faf8e93ce2d3faaa70da6deeb25b1cec26 (patch)
tree73afb2d58cff5b0be24f8846bd6c067830eb6c15 /meta/classes/image.bbclass
parent928df79cd3964f775c4c6e4283ef84b8882f9328 (diff)
downloadopenembedded-core-d3d810faf8e93ce2d3faaa70da6deeb25b1cec26.tar.gz
openembedded-core-d3d810faf8e93ce2d3faaa70da6deeb25b1cec26.tar.bz2
openembedded-core-d3d810faf8e93ce2d3faaa70da6deeb25b1cec26.zip
image.bbclass: remove unneeded files from the image
This patch creates a new function, rootfs_remove_unneeded(), that will be called after rootfs_*_do_rootfs is called and which will handle delayed postinstalls in a generic fashion, for all backends in the same way. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass33
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 04db533128..380ed8e09d 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -303,6 +303,9 @@ fakeroot do_rootfs () {
rootfs_${IMAGE_PKGTYPE}_do_rootfs
+ # remove unneeded packages/files from the final image
+ rootfs_remove_unneeded
+
insert_feed_uris
if [ "x${LDCONFIGDEPEND}" != "x" ]; then
@@ -463,6 +466,36 @@ rootfs_install_complementary() {
fi
}
+rootfs_remove_unneeded () {
+ if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
+ if [ -z "$(delayed_postinsts)" ]; 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
+ rootfs_remove_packages update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
+
+ # 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
+ else
+ # Some packages were not successfully configured, save them only
+ # if we have run-postinsts script present. Otherwise, they're
+ # useless
+ if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
+ save_postinsts
+ fi
+ fi
+
+ # Since no package manager is present in the image the metadata is not needed
+ remove_packaging_data_files
+ fi
+}
+
# set '*' as the root password so the images
# can decide if they want it or not
zap_root_password () {