diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-05-09 16:57:48 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-10 11:37:16 +0100 |
commit | e42f0acf46897515ae14c3b3c12632ccb2a378f2 (patch) | |
tree | 1c20e5768964b43eb2f88c1d128e2845c3178711 /meta/classes | |
parent | 68f441e303f9a1aa37f6d4606a9fe5a94998880f (diff) | |
download | poky-e42f0acf46897515ae14c3b3c12632ccb2a378f2.tar.gz |
classes/buildhistory: track contents of selected files in images
Add a BUILDHISTORY_IMAGE_FILES variable specifying a space-separated
list of files within an image to copy into buildhistory, so that changes
to them can be tracked. Typically this would be used for configuration
files, and by default this includes /etc/passwd and /etc/group, but the
user is free to extend this list by setting the variable in local.conf.
Implements [YOCTO #4154].
(From OE-Core rev: ed6bb6e3db518082d3a9c45d548bc1339be2c5ca)
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.bbclass | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 8efd41cd8e..3b6ce99413 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
@@ -12,6 +12,7 @@ BUILDHISTORY_DIR ?= "${TOPDIR}/buildhistory" | |||
12 | BUILDHISTORY_DIR_IMAGE = "${BUILDHISTORY_DIR}/images/${MACHINE_ARCH}/${TCLIBC}/${IMAGE_BASENAME}" | 12 | BUILDHISTORY_DIR_IMAGE = "${BUILDHISTORY_DIR}/images/${MACHINE_ARCH}/${TCLIBC}/${IMAGE_BASENAME}" |
13 | BUILDHISTORY_DIR_PACKAGE = "${BUILDHISTORY_DIR}/packages/${MULTIMACH_TARGET_SYS}/${PN}" | 13 | BUILDHISTORY_DIR_PACKAGE = "${BUILDHISTORY_DIR}/packages/${MULTIMACH_TARGET_SYS}/${PN}" |
14 | BUILDHISTORY_DIR_SDK = "${BUILDHISTORY_DIR}/sdk/${SDK_NAME}" | 14 | BUILDHISTORY_DIR_SDK = "${BUILDHISTORY_DIR}/sdk/${SDK_NAME}" |
15 | BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd /etc/group" | ||
15 | BUILDHISTORY_COMMIT ?= "0" | 16 | BUILDHISTORY_COMMIT ?= "0" |
16 | BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>" | 17 | BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>" |
17 | BUILDHISTORY_PUSH_REPO ?= "" | 18 | BUILDHISTORY_PUSH_REPO ?= "" |
@@ -396,6 +397,15 @@ buildhistory_get_imageinfo() { | |||
396 | 397 | ||
397 | buildhistory_list_files ${IMAGE_ROOTFS} ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt | 398 | buildhistory_list_files ${IMAGE_ROOTFS} ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt |
398 | 399 | ||
400 | # Collect files requested in BUILDHISTORY_IMAGE_FILES | ||
401 | rm -rf ${BUILDHISTORY_DIR_IMAGE}/image-files | ||
402 | for f in ${BUILDHISTORY_IMAGE_FILES}; do | ||
403 | if [ -f ${IMAGE_ROOTFS}/$f ] ; then | ||
404 | mkdir -p ${BUILDHISTORY_DIR_IMAGE}/image-files/`dirname $f` | ||
405 | cp ${IMAGE_ROOTFS}/$f ${BUILDHISTORY_DIR_IMAGE}/image-files/$f | ||
406 | fi | ||
407 | done | ||
408 | |||
399 | # Record some machine-readable meta-information about the image | 409 | # Record some machine-readable meta-information about the image |
400 | printf "" > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt | 410 | printf "" > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt |
401 | cat >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt <<END | 411 | cat >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt <<END |