diff options
author | Alex Kiernan <alex.kiernan@gmail.com> | 2020-01-18 05:41:07 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-19 23:49:39 +0000 |
commit | 8380df6566db49ef184b837432558750f77f592f (patch) | |
tree | 92f5b52538a41d74d8bedeeab723dba909cffacc /meta | |
parent | e3a844509c91d95f40b1cc8c949b604b0dc9f5f8 (diff) | |
download | poky-8380df6566db49ef184b837432558750f77f592f.tar.gz |
rootfs: Make BUILDNAME a weak default in reproducible_build_simple
11e45082ad00 ("rootfs-postcommands.bbclass: improve binary
reproducibility") fixed binary reproducibility of /etc/version, but with
the move to reproducibilty in all builds, setting /etc/version to
anything other than the default fixed timestamp is tricky because
rootfs_reproducible() runs very late.
rootfs.py uses BUILDNAME if set for /etc/version, so introduce a weak
default for BUILDNAME of "REPRODUCIBLE_TIMESTAMP_ROOTFS", when enabling
reproducible builds hence allowing BUILDNAME to be overridden elsewhere.
(From OE-Core rev: bbf28ea9100a4f86b052c5cd53c77f9e1c03fb09)
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/reproducible_build_simple.bbclass | 1 | ||||
-rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 5 |
2 files changed, 1 insertions, 5 deletions
diff --git a/meta/classes/reproducible_build_simple.bbclass b/meta/classes/reproducible_build_simple.bbclass index d0842f0f90..153a076072 100644 --- a/meta/classes/reproducible_build_simple.bbclass +++ b/meta/classes/reproducible_build_simple.bbclass | |||
@@ -7,5 +7,6 @@ export PERL_HASH_SEED = "0" | |||
7 | export SOURCE_DATE_EPOCH ??= "1520598896" | 7 | export SOURCE_DATE_EPOCH ??= "1520598896" |
8 | 8 | ||
9 | REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896" | 9 | REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896" |
10 | BUILDNAME ??= "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" | ||
10 | 11 | ||
11 | inherit podfix | 12 | inherit podfix |
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 2f171836fa..e40097444d 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass | |||
@@ -356,11 +356,6 @@ python rootfs_log_check_recommends() { | |||
356 | # Perform any additional adjustments needed to make rootf binary reproducible | 356 | # Perform any additional adjustments needed to make rootf binary reproducible |
357 | rootfs_reproducible () { | 357 | rootfs_reproducible () { |
358 | if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then | 358 | if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then |
359 | # Convert UTC into %4Y%2m%2d%2H%2M%2S | ||
360 | sformatted=`date -u -d @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S` | ||
361 | echo $sformatted > ${IMAGE_ROOTFS}/etc/version | ||
362 | bbnote "rootfs_reproducible: set /etc/version to $sformatted" | ||
363 | |||
364 | if [ -d ${IMAGE_ROOTFS}${sysconfdir}/gconf ]; then | 359 | if [ -d ${IMAGE_ROOTFS}${sysconfdir}/gconf ]; then |
365 | find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \ | 360 | find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \ |
366 | sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g' | 361 | sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g' |