summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2013-05-21 14:27:49 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-11 15:38:04 +0100
commit1ce182e79e6c588de4ca372587c0797bc0cb7e80 (patch)
treeb228037c1ae12137717a27a8f74382c671882e88
parentb11f8183074857be5a5920f093b4298884eec805 (diff)
downloadpoky-1ce182e79e6c588de4ca372587c0797bc0cb7e80.tar.gz
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. (From OE-Core rev: d3d810faf8e93ce2d3faaa70da6deeb25b1cec26) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 () {
303 303
304 rootfs_${IMAGE_PKGTYPE}_do_rootfs 304 rootfs_${IMAGE_PKGTYPE}_do_rootfs
305 305
306 # remove unneeded packages/files from the final image
307 rootfs_remove_unneeded
308
306 insert_feed_uris 309 insert_feed_uris
307 310
308 if [ "x${LDCONFIGDEPEND}" != "x" ]; then 311 if [ "x${LDCONFIGDEPEND}" != "x" ]; then
@@ -463,6 +466,36 @@ rootfs_install_complementary() {
463 fi 466 fi
464} 467}
465 468
469rootfs_remove_unneeded () {
470 if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
471 if [ -z "$(delayed_postinsts)" ]; then
472 # All packages were successfully configured.
473 # update-rc.d, base-passwd, run-postinsts are no further use, remove them now
474 remove_run_postinsts=false
475 if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
476 remove_run_postinsts=true
477 fi
478 rootfs_remove_packages update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
479
480 # Need to remove rc.d files for run-postinsts by hand since opkg won't
481 # call postrm scripts in offline root mode.
482 if $remove_run_postinsts; then
483 update-rc.d -f -r ${IMAGE_ROOTFS} run-postinsts remove
484 fi
485 else
486 # Some packages were not successfully configured, save them only
487 # if we have run-postinsts script present. Otherwise, they're
488 # useless
489 if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
490 save_postinsts
491 fi
492 fi
493
494 # Since no package manager is present in the image the metadata is not needed
495 remove_packaging_data_files
496 fi
497}
498
466# set '*' as the root password so the images 499# set '*' as the root password so the images
467# can decide if they want it or not 500# can decide if they want it or not
468zap_root_password () { 501zap_root_password () {