From 6671aff83e4082f3a825c456cf259b9e30ae702c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 3 Jan 2015 12:29:52 +0100 Subject: [PATCH] linux kernel determinism: unify timestamp style Testing showed the linux build is sensitive to /usr/include/ncursesw unless chrooted (on non-nixos). On a single chrooted nixos machine, -A linux is binary reproducible. CC #2281 & @alexanderkjeldaas. --- pkgs/os-specific/linux/kernel/generic.nix | 5 ++++- pkgs/os-specific/linux/kernel/manual-config.nix | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index af2ae3b54db4..b42892f9f2d8 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -57,7 +57,10 @@ let autoModules = stdenv.platform.kernelAutoModules; arch = stdenv.platform.kernelArch; - KBUILD_BUILD_TIMESTAMP = 1; # (time_t)1 + preConfigure = '' + buildFlagsArray+=("KBUILD_BUILD_TIMESTAMP=Thu Jan 1 00:00:01 UTC 1970") + ''; + crossAttrs = let cp = stdenv.cross.platform; in { diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index acc593035591..6d9baed7f2dd 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -105,7 +105,6 @@ let ''; buildFlags = [ - "KBUILD_BUILD_TIMESTAMP=1" # (time_t)1 "KBUILD_BUILD_VERSION=1-NixOS" platform.kernelTarget ] ++ optional isModular "modules";