From e24428521aad4c8f62a8876f97dfb377f5efad3a Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Wed, 1 Jun 2011 11:41:11 +0100 Subject: rootfs_ipk: delete opkg metadata if package management not required and all packages are configured If all the postinsts were successfully run in offline mode, and package-management hasn't been requested as an IMAGE_FEATURE, the opkg metadata is now redundant and can safely be deleted. Also, the update-rc.d and base-passwd packages can be removed since they will serve no further purpose in this situation. If some packages are still unconfigured at this point then we need to keep their metadata around so that either opkg or the awk script can configure the packages at boot time. In theory it would be possible to strip out the data for packages that have already been configured, but right now we just hold on to the whole status file in that situation. (From OE-Core rev: 87780fc09b066525e47d0f50ee5497db54d304cd) Signed-off-by: Phil Blundell Signed-off-by: Richard Purdie --- meta/classes/rootfs_ipk.bbclass | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'meta/classes/rootfs_ipk.bbclass') diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index edd84fb40d..3b4b4da43d 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass @@ -82,6 +82,17 @@ fakeroot rootfs_ipk_do_rootfs () { rm -f ${IMAGE_ROOTFS}${opkglibdir}/lists/* + if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then + if [ $runtime_script_required -eq 0 ]; then + # All packages were successfully configured. + # update-rc.d, base-passwd are no further use, remove them now + opkg-cl ${IPKG_ARGS} --force-depends remove update-rc.d base-passwd || true + + # Also delete the status files + rm -rf ${IMAGE_ROOTFS}${opkglibdir} + fi + fi + log_check rootfs } -- cgit v1.2.3-54-g00ecf