diff options
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/buildhistory.bbclass | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 34cc297909..69a9d02a5a 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
| @@ -312,6 +312,14 @@ buildhistory_get_imageinfo() { | |||
| 312 | # This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo | 312 | # This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo |
| 313 | ( 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 ) | 313 | ( 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 ) |
| 314 | 314 | ||
| 315 | # Record some machine-readable meta-information about the image | ||
| 316 | echo -n > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt | ||
| 317 | cat >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt <<END | ||
| 318 | ${@buildhistory_get_imagevars(d)} | ||
| 319 | END | ||
| 320 | imagesize=`du -ks ${IMAGE_ROOTFS} | awk '{ print $1 }'` | ||
| 321 | echo "IMAGESIZE = $imagesize" >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt | ||
| 322 | |||
| 315 | # Add some configuration information | 323 | # Add some configuration information |
| 316 | echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION}" > ${BUILDHISTORY_DIR_IMAGE}/build-id | 324 | echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION}" > ${BUILDHISTORY_DIR_IMAGE}/build-id |
| 317 | 325 | ||
| @@ -330,6 +338,16 @@ def buildhistory_get_layers(d): | |||
| 330 | return layertext | 338 | return layertext |
| 331 | 339 | ||
| 332 | 340 | ||
| 341 | def buildhistory_get_imagevars(d): | ||
| 342 | imagevars = "DISTRO DISTRO_VERSION USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS ROOTFS_POSTPROCESS_COMMAND IMAGE_POSTPROCESS_COMMAND" | ||
| 343 | |||
| 344 | ret = "" | ||
| 345 | for var in imagevars.split(): | ||
| 346 | value = d.getVar(var, True) or "" | ||
| 347 | ret += "%s = %s\n" % (var, value) | ||
| 348 | return ret.rstrip('\n') | ||
| 349 | |||
| 350 | |||
| 333 | buildhistory_commit() { | 351 | buildhistory_commit() { |
| 334 | if [ ! -d ${BUILDHISTORY_DIR} ] ; then | 352 | if [ ! -d ${BUILDHISTORY_DIR} ] ; then |
| 335 | # Code above that creates this dir never executed, so there can't be anything to commit | 353 | # Code above that creates this dir never executed, so there can't be anything to commit |
