summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-14 12:58:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-16 17:41:59 +0100
commit20f6477b6323c723f856c5c29358a04029af7493 (patch)
treef214bc3be31392aa459787a01fc7d87607b9a4c6
parent0dc5920862dd692905347104927f7cf0b7d61376 (diff)
downloadpoky-20f6477b6323c723f856c5c29358a04029af7493.tar.gz
reproducible: Drop BUILD_REPRODUCIBLE_BINARIES variable
We want things to be reproduicble and the variable doesn't really change much any more. Drop the remaining uses and make those code paths always active. (From OE-Core rev: d15fb02c7ee7da50e322d74bc6a545234e20c7f3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/image-prelink.bbclass13
-rw-r--r--meta/classes/image.bbclass14
-rw-r--r--meta/conf/bitbake.conf1
-rw-r--r--meta/lib/oe/sstatesig.py2
-rw-r--r--meta/recipes-core/busybox/busybox.inc10
5 files changed, 15 insertions, 25 deletions
diff --git a/meta/classes/image-prelink.bbclass b/meta/classes/image-prelink.bbclass
index 0da094a551..8158eeaf4c 100644
--- a/meta/classes/image-prelink.bbclass
+++ b/meta/classes/image-prelink.bbclass
@@ -46,17 +46,12 @@ prelink_image () {
46 dynamic_loader=${@get_linuxloader(d)} 46 dynamic_loader=${@get_linuxloader(d)}
47 47
48 # prelink! 48 # prelink!
49 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then 49 if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
50 bbnote " prelink: BUILD_REPRODUCIBLE_BINARIES..." 50 export PRELINK_TIMESTAMP=`git log -1 --pretty=%ct `
51 if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
52 export PRELINK_TIMESTAMP=`git log -1 --pretty=%ct `
53 else
54 export PRELINK_TIMESTAMP=$REPRODUCIBLE_TIMESTAMP_ROOTFS
55 fi
56 ${STAGING_SBINDIR_NATIVE}/prelink --root ${IMAGE_ROOTFS} -am -N -c ${sysconfdir}/prelink.conf --dynamic-linker $dynamic_loader
57 else 51 else
58 ${STAGING_SBINDIR_NATIVE}/prelink --root ${IMAGE_ROOTFS} -amR -N -c ${sysconfdir}/prelink.conf --dynamic-linker $dynamic_loader 52 export PRELINK_TIMESTAMP=$REPRODUCIBLE_TIMESTAMP_ROOTFS
59 fi 53 fi
54 ${STAGING_SBINDIR_NATIVE}/prelink --root ${IMAGE_ROOTFS} -am -N -c ${sysconfdir}/prelink.conf --dynamic-linker $dynamic_loader
60 55
61 # Remove the prelink.conf if we had to add it. 56 # Remove the prelink.conf if we had to add it.
62 if [ "$dummy_prelink_conf" = "true" ]; then 57 if [ "$dummy_prelink_conf" = "true" ]; then
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index c2f3232027..2fa69a40d1 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -651,17 +651,15 @@ ROOTFS_PREPROCESS_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge'
651POPULATE_SDK_PRE_TARGET_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_sdk; ', '',d)}" 651POPULATE_SDK_PRE_TARGET_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_sdk; ', '',d)}"
652 652
653reproducible_final_image_task () { 653reproducible_final_image_task () {
654 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then 654 if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
655 REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}" log -1 --pretty=%ct 2>/dev/null` || true
655 if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then 656 if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
656 REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}" log -1 --pretty=%ct 2>/dev/null` || true 657 REPRODUCIBLE_TIMESTAMP_ROOTFS=`stat -c%Y ${@bb.utils.which(d.getVar("BBPATH"), "conf/bitbake.conf")}`
657 if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
658 REPRODUCIBLE_TIMESTAMP_ROOTFS=`stat -c%Y ${@bb.utils.which(d.getVar("BBPATH"), "conf/bitbake.conf")}`
659 fi
660 fi 658 fi
661 # Set mtime of all files to a reproducible value
662 bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS"
663 find ${IMAGE_ROOTFS} -print0 | xargs -0 touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS
664 fi 659 fi
660 # Set mtime of all files to a reproducible value
661 bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS"
662 find ${IMAGE_ROOTFS} -print0 | xargs -0 touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS
665} 663}
666 664
667systemd_preset_all () { 665systemd_preset_all () {
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 1db9b3fc05..790f2f7a8c 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -636,7 +636,6 @@ SDE_DIR = "${WORKDIR}/source-date-epoch"
636SDE_FILE = "${SDE_DIR}/__source_date_epoch.txt" 636SDE_FILE = "${SDE_DIR}/__source_date_epoch.txt"
637SDE_DEPLOYDIR = "${WORKDIR}/deploy-source-date-epoch" 637SDE_DEPLOYDIR = "${WORKDIR}/deploy-source-date-epoch"
638 638
639BUILD_REPRODUCIBLE_BINARIES = "1"
640export PYTHONHASHSEED = "0" 639export PYTHONHASHSEED = "0"
641export PERL_HASH_SEED = "0" 640export PERL_HASH_SEED = "0"
642export SOURCE_DATE_EPOCH ?= "${@get_source_date_epoch_value(d)}" 641export SOURCE_DATE_EPOCH ?= "${@get_source_date_epoch_value(d)}"
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index c2e3e2f4f5..038404e377 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -489,7 +489,7 @@ def OEOuthashBasic(path, sigfile, task, d):
489 include_timestamps = False 489 include_timestamps = False
490 include_root = True 490 include_root = True
491 if task == "package": 491 if task == "package":
492 include_timestamps = d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1' 492 include_timestamps = True
493 include_root = False 493 include_root = False
494 extra_content = d.getVar('HASHEQUIV_HASH_VERSION') 494 extra_content = d.getVar('HASHEQUIV_HASH_VERSION')
495 495
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 808c3dc700..622325aabb 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -110,9 +110,8 @@ python () {
110} 110}
111 111
112do_prepare_config () { 112do_prepare_config () {
113 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then 113 export KCONFIG_NOTIMESTAMP=1
114 export KCONFIG_NOTIMESTAMP=1 114
115 fi
116 sed -e '/CONFIG_STATIC/d' \ 115 sed -e '/CONFIG_STATIC/d' \
117 < ${WORKDIR}/defconfig > ${S}/.config 116 < ${WORKDIR}/defconfig > ${S}/.config
118 echo "# CONFIG_STATIC is not set" >> .config 117 echo "# CONFIG_STATIC is not set" >> .config
@@ -143,9 +142,8 @@ do_configure () {
143 142
144do_compile() { 143do_compile() {
145 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS 144 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
146 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then 145 export KCONFIG_NOTIMESTAMP=1
147 export KCONFIG_NOTIMESTAMP=1 146
148 fi
149 if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then 147 if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
150 # split the .config into two parts, and make two busybox binaries 148 # split the .config into two parts, and make two busybox binaries
151 if [ -e .config.orig ]; then 149 if [ -e .config.orig ]; then