diff --git a/debian/changelog b/debian/changelog index b20291f8a..6af62d619 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,10 @@ linux (4.1~rc3-1~exp1) UNRELEASED; urgency=medium * New upstream release candidate + [ Ben Hutchings ] + * linux-image: Fix timestamps in the built-in initramfs for reproducible + build + -- Ben Hutchings Mon, 11 May 2015 16:19:42 +0100 linux (4.0.2-1) unstable; urgency=medium diff --git a/debian/patches/debian/uname-version-timestamp.patch b/debian/patches/debian/uname-version-timestamp.patch new file mode 100644 index 000000000..5cd565c1e --- /dev/null +++ b/debian/patches/debian/uname-version-timestamp.patch @@ -0,0 +1,33 @@ +From: Ben Hutchings +Subject: Make mkcompile_h accept an alternate timestamp string +Date: Tue, 12 May 2015 19:29:22 +0100 +Forwarded: not-needed + +We want to include the Debian version in the utsname::version string +instead of a full timestamp string. However, we still need to provide +a standard timestamp string for gen_initramfs_list.sh to make the +kernel image reproducible. + +Make mkcompile_h use $KBUILD_BUILD_VERSION_TIMESTAMP in preference to +$KBUILD_BUILD_TIMESTAMP. + +--- a/scripts/mkcompile_h ++++ b/scripts/mkcompile_h +@@ -37,10 +37,14 @@ else + VERSION=$KBUILD_BUILD_VERSION + fi + +-if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then +- TIMESTAMP=`date` ++if [ -z "$KBUILD_BUILD_VERSION_TIMESTAMP" ]; then ++ if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then ++ TIMESTAMP=`date` ++ else ++ TIMESTAMP=$KBUILD_BUILD_TIMESTAMP ++ fi + else +- TIMESTAMP=$KBUILD_BUILD_TIMESTAMP ++ TIMESTAMP=$KBUILD_BUILD_VERSION_TIMESTAMP + fi + if test -z "$KBUILD_BUILD_USER"; then + LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/') diff --git a/debian/patches/series b/debian/patches/series index 79a24e09e..4696d6342 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,5 +1,6 @@ # Changes to support package build system debian/version.patch +debian/uname-version-timestamp.patch debian/kernelvariables.patch debian/gitignore.patch debian/ia64-hardcode-arch-script-output.patch diff --git a/debian/rules.real b/debian/rules.real index ac9da7baa..1052e9c98 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -15,6 +15,7 @@ endif MAINTAINER := $(shell sed -ne 's,^Maintainer: .[^<]*<\([^>]*\)>,\1,p' debian/control) DISTRIBUTION := $(shell dpkg-parsechangelog | sed -ne 's,^Distribution: ,,p') SOURCE_DATE := $(shell dpkg-parsechangelog | sed -ne 's,^Date: ,,p') +SOURCE_DATE_UTC_822 := $(shell date -u -d '$(SOURCE_DATE)' -R) SOURCE_DATE_UTC_ISO := $(shell date -u -d '$(SOURCE_DATE)' +%Y-%m-%d) DISTRIBUTOR := $(shell lsb_release -is 2>/dev/null) @@ -39,7 +40,7 @@ include debian/rules.defs stamp = [ -d $(dir $@) ] || mkdir $(dir $@); touch $@ setup_env := env -u ABINAME -u ARCH -u FEATURESET -u FLAVOUR -u VERSION -u LOCALVERSION -setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTOR="$(DISTRIBUTOR)" DISTRIBUTION_VERSION="$(SOURCEVERSION)" KBUILD_BUILD_TIMESTAMP="$(DISTRIBUTOR) $(SOURCEVERSION) ($(SOURCE_DATE_UTC_ISO))" KBUILD_BUILD_USER="$(word 1,$(subst @, ,$(MAINTAINER)))" KBUILD_BUILD_HOST="$(word 2,$(subst @, ,$(MAINTAINER)))" +setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTOR="$(DISTRIBUTOR)" DISTRIBUTION_VERSION="$(SOURCEVERSION)" KBUILD_BUILD_TIMESTAMP="$(SOURCE_DATE_UTC_822)" KBUILD_BUILD_VERSION_TIMESTAMP="$(DISTRIBUTOR) $(SOURCEVERSION) ($(SOURCE_DATE_UTC_ISO))" KBUILD_BUILD_USER="$(word 1,$(subst @, ,$(MAINTAINER)))" KBUILD_BUILD_HOST="$(word 2,$(subst @, ,$(MAINTAINER)))" MAKE_CLEAN = $(setup_env) $(MAKE) MAKE_SELF := $(MAKE) -f debian/rules.real $(MAKEOVERRIDES)