From 984d8f83063e79ee5f09222312356c5eeefbfa82db803da5d9e5ce363115b953 Mon Sep 17 00:00:00 2001 From: nick wang Date: Wed, 19 Jul 2017 14:13:03 +0000 Subject: [PATCH] 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 $@