[OE-core] [OE-Core][PATCH] image: Use ${COREBASE}/meta for timestamp, fallback to bitbake.conf
Alex Kiernan
alex.kiernan at gmail.com
Thu Jul 19 17:12:59 UTC 2018
To handle the case where ${COREBASE} isn't the git directory, but
${COREBASE}/meta might be (since that's the layer that sets up the COREBASE
variable), use the timestamp from there. If that fails use the timestamp
from conf/bitbake.conf.
Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
---
meta/classes/image.bbclass | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index adc50c9..0afebff 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -651,7 +651,10 @@ POPULATE_SDK_PRE_TARGET_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usr
reproducible_final_image_task () {
if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
- REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}" log -1 --pretty=%ct`
+ REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}/meta" log -1 --pretty=%ct 2>/dev/null` || true
+ if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" = "" ]; then
+ REPRODUCIBLE_TIMESTAMP_ROOTFS=`stat -c%Y ${@bb.utils.which(d.getVar("BBPATH"), "conf/bitbake.conf")}`
+ fi
fi
# Set mtime of all files to a reproducible value
bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS"
--
2.7.4
More information about the Openembedded-core
mailing list