From 960e305d9abbbeed0ed2d5251ff94cf1719e5159 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Tue, 26 Nov 2013 12:09:52 +0000 Subject: classes/image: write image manifest Write a list of installed packages to a .manifest file next to the image, so we can find out what went into the image after it has been constructed without necessarily having to have buildhistory enabled (although that will provide more detail.) We can make use of this for example in the testimage class associated code that checks for installed packages for determining whether or not to run specific tests. Note: this replaces the previous ipk-specific manifest code with something that works for ipk, rpm and deb, and instead of a pruned status file, packages are listed one per line, in the following format: Tests for all three backends have shown that the performance impact of this change is negligible (about 1.5s max). Implements [YOCTO #5410] (From OE-Core rev: 2978d1f2617a33e2e3a77e249d73e998d79b4ec9) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- meta/classes/image.bbclass | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'meta/classes/image.bbclass') diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index bc60f0d..8217fb3 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -179,6 +179,9 @@ ROOTFS_POSTPROCESS_COMMAND_prepend = "run_intercept_scriptlets; " ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "ssh_allow_empty_password; ", "",d)}' # Enable postinst logging if debug-tweaks is enabled ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "postinst_enable_logging; ", "",d)}' +# Write manifest +IMAGE_MANIFEST = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest" +ROOTFS_POSTPROCESS_COMMAND =+ "write_image_manifest ; " # Set default postinst log file POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log" @@ -381,6 +384,11 @@ fakeroot do_rootfs () { ${IMAGE_POSTPROCESS_COMMAND} ${MACHINE_POSTPROCESS_COMMAND} + + if [ -n "${IMAGE_LINK_NAME}" -a -f "${IMAGE_MANIFEST}" ]; then + rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.manifest + ln -s ${IMAGE_NAME}.rootfs.manifest ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.manifest + fi } insert_feed_uris () { @@ -602,12 +610,7 @@ make_zimage_symlink_relative () { } write_image_manifest () { - rootfs_${IMAGE_PKGTYPE}_write_manifest - - if [ -n "${IMAGE_LINK_NAME}" ]; then - rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.manifest - ln -s ${IMAGE_NAME}.rootfs.manifest ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.manifest - fi + list_installed_packages ver | sort > ${IMAGE_MANIFEST} } # Make login manager(s) enable automatic login. -- cgit v1.1