summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2018-07-20 04:33:17 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-15 21:45:58 +0100
commit7f93c8bc4a6e441f1b91824878ffec46ccd21a30 (patch)
treee050b88c2ab2c8f269ea1d1f20780973d23a51a2 /meta/classes/image.bbclass
parentf163fd8ec4333f32a32c21d867ef56b40e3eadaa (diff)
downloadpoky-7f93c8bc4a6e441f1b91824878ffec46ccd21a30.tar.gz
image: Use ${COREBASE}/meta for timestamp, fallback to bitbake.conf
To handle the case where ${COREBASE} isn't the git directory, avoid erroring out when the git command fails. If we don't have a timestamp after this, fall back to the timestamp from conf/bitbake.conf. (From OE-Core rev: 97b439469a45a089431ca9c31893288c855045f4) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index c0a2714288..5ae0910aa6 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -650,7 +650,10 @@ POPULATE_SDK_PRE_TARGET_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usr
650reproducible_final_image_task () { 650reproducible_final_image_task () {
651 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then 651 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
652 if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then 652 if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
653 REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}" log -1 --pretty=%ct` 653 REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}" log -1 --pretty=%ct 2>/dev/null` || true
654 if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" = "" ]; then
655 REPRODUCIBLE_TIMESTAMP_ROOTFS=`stat -c%Y ${@bb.utils.which(d.getVar("BBPATH"), "conf/bitbake.conf")}`
656 fi
654 fi 657 fi
655 # Set mtime of all files to a reproducible value 658 # Set mtime of all files to a reproducible value
656 bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS" 659 bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS"