Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] systemd: set time epoch for reproducible builds
@ 2017-11-16 17:03 John Keeping
  2017-11-17  9:55 ` Thomas Petazzoni
  2017-11-22 21:16 ` Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: John Keeping @ 2017-11-16 17:03 UTC (permalink / raw)
  To: buildroot

Systemd embeds a timestamp which is used to impose a minimum bound on
the system time during boot.  Normally this comes from stat'ing the NEWS
file included with the systemd source, but this makes the build
non-reproducible.  Pass in $SOURCE_DATE_EPOCH to use a deterministic
timestamp when reproducible builds are enabled.

Signed-off-by: John Keeping <john@metanate.com>
---
 package/systemd/systemd.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 9f286fd54b..d87c9d33dd 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -40,6 +40,11 @@ SYSTEMD_CONF_OPTS += \
 	--with-default-dnssec=no \
 	--without-python
 
+ifeq ($(BR2_REPRODUCIBLE),y)
+SYSTEMD_CONF_OPTS += \
+	--with-time-epoch=$(SOURCE_DATE_EPOCH)
+endif
+
 SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-lto
 
 # Override paths to a few utilities needed at runtime, to
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-23 12:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-16 17:03 [Buildroot] [PATCH] systemd: set time epoch for reproducible builds John Keeping
2017-11-17  9:55 ` Thomas Petazzoni
2017-11-17 10:33   ` Peter Korsgaard
2017-11-22 21:16 ` Thomas Petazzoni
2017-11-23 12:26   ` John Keeping

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox