From patchwork Thu May 26 11:29:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: rootfs_ipk: delete opkg metadata if package management not required and all packages are configured Date: Thu, 26 May 2011 11:29:35 -0000 From: Phil Blundell X-Patchwork-Id: 4811 Message-Id: <1306409375.2525.323.camel@phil-desktop> To: Patches and discussions about the oe-core layer 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. 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. Signed-off-by: Phil Blundell --- meta/classes/rootfs_ipk.bbclass | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index edd84fb..53099e9 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass @@ -82,6 +82,13 @@ 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, status file no longer required + rm -rf ${IMAGE_ROOTFS}${opkglibdir} + fi + fi + log_check rootfs }