diff options
-rw-r--r-- | meta/classes/image.bbclass | 33 |
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 | ||
469 | rootfs_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 |
468 | zap_root_password () { | 501 | zap_root_password () { |