summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-01-19 10:32:09 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-19 14:34:32 +0000
commit2f4f8ef0fc5f2ff024e21903520a2680b0524721 (patch)
treee41336ca9b1398f1b4963017114d9650564b8fbc /meta/classes
parentffa93f0e25565475d9d8c410a79c59e13759182b (diff)
downloadast2050-yocto-poky-2f4f8ef0fc5f2ff024e21903520a2680b0524721.zip
ast2050-yocto-poky-2f4f8ef0fc5f2ff024e21903520a2680b0524721.tar.gz
buildhistory: record additional image info
Record some additional information about images - the uncompressed size of the final image as well as the values of various variables that may have influenced its contents. This is recorded in a machine-readable "image-info.txt" file similar in structure to the package history files. Also add some code to analyse changes to these values. (Most of the variable values aren't monitored directly but will be used as contextual information when they change at the same time as the content of the image changing.) (From OE-Core rev: 459ed6759a307b389f6ec1874136ec9aa0749120) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/buildhistory.bbclass18
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 34cc297..69a9d02 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -312,6 +312,14 @@ buildhistory_get_imageinfo() {
# This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo
( cd ${IMAGE_ROOTFS} && find . -ls | awk '{ if ( $7 ~ /[0-9]/ ) printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, $7, $11, $12, $13 ; else printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, 0, $10, $11, $12 }' > ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt )
+ # Record some machine-readable meta-information about the image
+ echo -n > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt
+ cat >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt <<END
+${@buildhistory_get_imagevars(d)}
+END
+ imagesize=`du -ks ${IMAGE_ROOTFS} | awk '{ print $1 }'`
+ echo "IMAGESIZE = $imagesize" >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt
+
# Add some configuration information
echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION}" > ${BUILDHISTORY_DIR_IMAGE}/build-id
@@ -330,6 +338,16 @@ def buildhistory_get_layers(d):
return layertext
+def buildhistory_get_imagevars(d):
+ imagevars = "DISTRO DISTRO_VERSION USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS ROOTFS_POSTPROCESS_COMMAND IMAGE_POSTPROCESS_COMMAND"
+
+ ret = ""
+ for var in imagevars.split():
+ value = d.getVar(var, True) or ""
+ ret += "%s = %s\n" % (var, value)
+ return ret.rstrip('\n')
+
+
buildhistory_commit() {
if [ ! -d ${BUILDHISTORY_DIR} ] ; then
# Code above that creates this dir never executed, so there can't be anything to commit
OpenPOWER on IntegriCloud