Hello!

I noticed that the linux-libre package we have is not a reproducible build using the command: guix build linux-libre --check --no-substitutes

I did a bit of research into this these posts and blogs were helpful, as well as the mempo project:
* <https://lwn.net/Articles/437864/>
* <https://abraithwaite.net/2014/08/11/deterministic-kernel-builds/>
* <https://github.com/rfree/mempo-kernel/blob/master/kernel-build/linux-mempo/build.sh#L95>

So I've added these tweaks, performed the build twice and it seems to be reproducible now! Would anyone like to test it and see if they do get the same build? (On x86_64)

/gnu/store/zbzs26xa68znnlgvgqchm4y7lxbnl4gg-linux-libre-det-4.5

Cheers.
From 713017b65c9d5a03dcf709bb231113d2152558e1 Mon Sep 17 00:00:00 2001
From: rain1 <[email protected]>
Date: Wed, 30 Mar 2016 13:05:19 +0100
Subject: [PATCH] * gnu/packages/linux.scm: Added setenv calls to tune the
 build towards reproducibility.

---
 gnu/packages/linux.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index fb2b671..34403ae 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2016 Christopher Allan Webber <[email protected]>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <[email protected]>
 ;;; Copyright © 2016 Alex Kost <[email protected]>
+;;; Copyright © 2016 Raymond Nicholson <[email protected]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -223,6 +224,12 @@ for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
   (let* ((version "4.5")
          (build-phase
           '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
+             ;; Tuning for a reproducible build
+             (setenv "KCONFIG_NOTIMESTAMP" "1")
+             (setenv "KBUILD_BUILD_TIMESTAMP" "0")
+             (setenv "KBUILD_BUILD_USER" "guix")
+             (setenv "KBUILD_BUILD_HOST" "guix")
+             
              ;; Apply the neat patch.
              (system* "patch" "-p1" "--force"
                       "-i" (assoc-ref inputs "patch/freedo+gnu"))
-- 
2.7.3

Reply via email to