diff mbox

[v2,05/15] reproducibility/linux: override build timestamp

Message ID 1479460224-6119-6-git-send-email-jezz@sysmic.org
State Superseded
Headers show

Commit Message

Jérôme Pouiller Nov. 18, 2016, 9:10 a.m. UTC
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>

Linux kernel include a few information about build environment in its binary.
This feature is incompatible with BR2_REPRODUCIBLE. This patch overload build
information when BR2_REPRODUCIBLE is enabled.

Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
---
 linux/linux.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Thomas Petazzoni Nov. 18, 2016, 11:40 a.m. UTC | #1
Hello,

On Fri, 18 Nov 2016 10:10:14 +0100, Jérôme Pouiller wrote:

> +ifeq ($(BR2_REPRODUCIBLE),y)
> +LINUX_MAKE_ENV += \
> +	KBUILD_BUILD_VERSION=1 \
> +	KBUILD_BUILD_USER=buildroot \
> +	KBUILD_BUILD_HOST=buildroot \
> +	KBUILD_BUILD_TIMESTAMP="$(shell date -d @$(SOURCE_DATE_EPOCH))"

With your "fakedate" script, do we really need this last line?

Thomas
Jérôme Pouiller Nov. 19, 2016, 1:53 p.m. UTC | #2
On Friday 18 November 2016 12:40:35 Thomas Petazzoni wrote:
> Hello,
> 
> On Fri, 18 Nov 2016 10:10:14 +0100, Jérôme Pouiller wrote:
> 
> > +ifeq ($(BR2_REPRODUCIBLE),y)
> > +LINUX_MAKE_ENV += \
> > +	KBUILD_BUILD_VERSION=1 \
> > +	KBUILD_BUILD_USER=buildroot \
> > +	KBUILD_BUILD_HOST=buildroot \
> > +	KBUILD_BUILD_TIMESTAMP="$(shell date -d @$(SOURCE_DATE_EPOCH))"
> 
> With your "fakedate" script, do we really need this last line?

I prefer to use native solution when upstream provide one. I hope one
day all packages will be fixed by upstream and we could get ride of
fakedate.
Arnout Vandecappelle Nov. 19, 2016, 4:10 p.m. UTC | #3
On 19-11-16 14:53, Jérôme Pouiller wrote:
> On Friday 18 November 2016 12:40:35 Thomas Petazzoni wrote:
>> Hello,
>>
>> On Fri, 18 Nov 2016 10:10:14 +0100, Jérôme Pouiller wrote:
>>
>>> +ifeq ($(BR2_REPRODUCIBLE),y)
>>> +LINUX_MAKE_ENV += \
>>> +	KBUILD_BUILD_VERSION=1 \
>>> +	KBUILD_BUILD_USER=buildroot \
>>> +	KBUILD_BUILD_HOST=buildroot \
>>> +	KBUILD_BUILD_TIMESTAMP="$(shell date -d @$(SOURCE_DATE_EPOCH))"
>>
>> With your "fakedate" script, do we really need this last line?
> 
> I prefer to use native solution when upstream provide one. I hope one
> day all packages will be fixed by upstream and we could get ride of
> fakedate.

 +1 to that. Could you explain this in the commit message?

 Regards,
 Arnout
diff mbox

Patch

diff --git a/linux/linux.mk b/linux/linux.mk
index 988427c..7e826cc 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -94,6 +94,14 @@  LINUX_MAKE_ENV = \
 	$(TARGET_MAKE_ENV) \
 	BR_BINARIES_DIR=$(BINARIES_DIR)
 
+ifeq ($(BR2_REPRODUCIBLE),y)
+LINUX_MAKE_ENV += \
+	KBUILD_BUILD_VERSION=1 \
+	KBUILD_BUILD_USER=buildroot \
+	KBUILD_BUILD_HOST=buildroot \
+	KBUILD_BUILD_TIMESTAMP="$(shell date -d @$(SOURCE_DATE_EPOCH))"
+endif
+
 # Get the real Linux version, which tells us where kernel modules are
 # going to be installed in the target filesystem.
 LINUX_VERSION_PROBED = `$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease 2>/dev/null`