]> code.ossystems Code Review - openembedded-core.git/commitdiff
rootfs: Make BUILDNAME a weak default in reproducible_build_simple
authorAlex Kiernan <alex.kiernan@gmail.com>
Sat, 18 Jan 2020 05:41:07 +0000 (05:41 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 19 Jan 2020 23:49:15 +0000 (23:49 +0000)
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.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/reproducible_build_simple.bbclass
meta/classes/rootfs-postcommands.bbclass

index d0842f0f902ae8270b01b98ac26555472e96b2dd..153a0760721904f37f7ae2ef96212d67ae84b69f 100644 (file)
@@ -7,5 +7,6 @@ export PERL_HASH_SEED = "0"
 export SOURCE_DATE_EPOCH ??= "1520598896"
 
 REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896"
+BUILDNAME ??= "${REPRODUCIBLE_TIMESTAMP_ROOTFS}"
 
 inherit podfix
index 2f171836fa0cce8d662619a00a0f1ad2a4659087..e40097444d596abad46edc2de9fd9f045bd1306c 100644 (file)
@@ -356,11 +356,6 @@ python rootfs_log_check_recommends() {
 # Perform any additional adjustments needed to make rootf binary reproducible
 rootfs_reproducible () {
        if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
-               # Convert UTC into %4Y%2m%2d%2H%2M%2S
-               sformatted=`date -u -d @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S`
-               echo $sformatted > ${IMAGE_ROOTFS}/etc/version
-               bbnote "rootfs_reproducible: set /etc/version to $sformatted"
-
                if [ -d ${IMAGE_ROOTFS}${sysconfdir}/gconf ]; then
                        find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \
                        sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g'