[Drbd-dev] [PATCH] drbd: Allow to override build date (v3)

Bernhard M. Wiedemann bwiedemann at suse.de
Tue Jul 18 14:48:13 CEST 2017


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.
---
 drbd/Kbuild | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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



More information about the drbd-dev mailing list