From c3b1cc4105780b0807ddc5638aa5b93082891a76dd4852a0e68e0967f9d11b6b Mon Sep 17 00:00:00 2001 From: Lars Marowsky-Bree Date: Wed, 19 Jul 2017 07:00:23 +0000 Subject: [PATCH 1/2] Accepting request 511346 from home:bmwiedemann:branches:network:ha-clustering:Factory Add reproducible.patch to sort file lists (boo#1041090) and to override build date (boo#1047218) to fix build-compare OBS-URL: https://build.opensuse.org/request/show/511346 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=51 --- drbd.changes | 6 ++++++ drbd.spec | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drbd.changes b/drbd.changes index 37a2f91..cf24e22 100644 --- a/drbd.changes +++ b/drbd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 19 05:01:10 UTC 2017 - bwiedemann@suse.com + +- Add reproducible.patch to sort file lists (boo#1041090) + and to override build date (boo#1047218) to fix build-compare + ------------------------------------------------------------------- Wed Jun 14 03:21:59 UTC 2017 - nwang@suse.com diff --git a/drbd.spec b/drbd.spec index 48c6824..638b41e 100644 --- a/drbd.spec +++ b/drbd.spec @@ -14,10 +14,9 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - - # needssslcertforbuild + %if ! 0%{?is_opensuse} %ifarch x86_64 %define buildrt 1 @@ -37,6 +36,8 @@ Source1: preamble Source2: Module.supported Source3: drbd_git_revision Patch1: fix-resync-finished-with-syncs-have-bits-set.patch +# PATCH-FIX-UPSTREAM bmwiedemann +Patch2: reproducible.patch BuildRequires: kernel-source BuildRequires: kernel-syms BuildRequires: module-init-tools @@ -69,6 +70,7 @@ installed kernel. %prep %setup -q -n drbd-%{version} %patch1 -p1 +%patch2 -p1 mkdir source cp -a drbd/. source/. || : @@ -79,6 +81,7 @@ rm -rf obj mkdir obj ln -s ../scripts obj/ +export WANT_DRBD_REPRODUCIBLE_BUILD=1 export CONFIG_BLK_DEV_DRBD=m export EXTRA_CFLAGS='-DVERSION=\"%{version}\"' From 984d8f83063e79ee5f09222312356c5eeefbfa82db803da5d9e5ce363115b953 Mon Sep 17 00:00:00 2001 From: nick wang Date: Wed, 19 Jul 2017 14:13:03 +0000 Subject: [PATCH 2/2] Accepting request 511366 from home:wanghaisu:branches:network:ha-clustering:Factory Add missing reproducible.patch based on Bernhard's patch in mailing list. OBS-URL: https://build.opensuse.org/request/show/511366 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=52 --- reproducible.patch | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 reproducible.patch diff --git a/reproducible.patch b/reproducible.patch new file mode 100644 index 0000000..49e648b --- /dev/null +++ b/reproducible.patch @@ -0,0 +1,53 @@ +commit 9777375cea4d39a6298b774c80eb1287836b217d +Author: Bernhard M. Wiedemann +Date: Mon Jul 17 21:05:47 2017 +0200 + + drbd: sort file list + + because it influences the ordering of entries in compat.h + which influences srcversion= checksum + which prevents drbd.ko from building reproducibly. + + See https://reproducible-builds.org/ for why this matters. + +diff --git a/drbd/Kbuild b/drbd/Kbuild +index 2d1b4d0..c5787a6 100644 +--- a/drbd/Kbuild ++++ b/drbd/Kbuild +@@ -70,7 +70,7 @@ COMPAT_FORCE := FORCE + endif + + ifneq ($(KBUILD_STAGE),modpost) +-TEST_C := $(wildcard $(src)/drbd-kernel-compat/tests/*.c) ++TEST_C := $(sort $(wildcard $(src)/drbd-kernel-compat/tests/*.c)) + TEST_R := $(TEST_C:$(src)/drbd-kernel-compat/tests/%.c=$(obj)/.compat_test.%.result) + $(obj)/.compat_test.%.result: $(src)/drbd-kernel-compat/tests/%.c $(COMPAT_FORCE) + $(call cmd,compat_test_result) +commit 794951592b004e82c0160014751d9ebb654035c0 +Author: Bernhard M. Wiedemann +Date: Tue Jul 18 10:30:16 2017 +0200 + + drbd: Allow to override build date (v3) + + and to not record build user and hostname if requested + in order to allow for reproducible builds. + See https://reproducible-builds.org/ for why this is good + and https://reproducible-builds.org/specs/source-date-epoch/ + for the definition of this variable. + +diff --git a/drbd/Kbuild b/drbd/Kbuild +index 2d1b4d0..80b8099 100644 +--- a/drbd/Kbuild ++++ b/drbd/Kbuild +@@ -134,5 +134,10 @@ $(obj)/drbd_buildtag.c: $(filter-out drbd_buildtag.o,$(drbd-y)) + echo >&2 "Your DRBD source tree is broken. Unpack again."; \ + exit 1; \ + fi ; \ +- echo -e "\t\t\" build by $$USER@$$HOSTNAME, `date "+%F %T"`\";\n}"; \ ++ if [ -z "${WANT_DRBD_REPRODUCIBLE_BUILD}" ] || [ -z "${SOURCE_DATE_EPOCH}" ] ; then \ ++ buildinfo="build by $$USER@$$HOSTNAME, `date "+%F %T"`" ; \ ++ else \ ++ buildinfo="reproducible build, `date -u -d@${SOURCE_DATE_EPOCH} "+%F %T"`" ; \ ++ fi ; \ ++ echo -e "\t\t\" $$buildinfo\";\n}"; \ + mv -f $@.new $@