Accepting request 511431 from network:ha-clustering:Factory

1

OBS-URL: https://build.opensuse.org/request/show/511431
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/drbd?expand=0&rev=60
This commit is contained in:
Dominique Leuenberger 2017-07-21 20:49:43 +00:00 committed by Git OBS Bridge
commit bd45d7ba45
3 changed files with 64 additions and 2 deletions

View File

@ -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

View File

@ -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}\"'

53
reproducible.patch Normal file
View File

@ -0,0 +1,53 @@
commit 9777375cea4d39a6298b774c80eb1287836b217d
Author: Bernhard M. Wiedemann <bwiedemann@suse.de>
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 <bwiedemann@suse.de>
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 $@