Source: nxt-firmware Version: 1.29-20120908+dfsg-3 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: timestamps X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org
Hi, While working on the "reproducible builds" effort [1], we have noticed that nxt-firmware could not be built reproducibly. Part of the source code used to build the firmware image embeds the build timestamp through the __DATE__ and __TIME__ gcc macros. Unfortunately arm-none-eabi-gcc doesn't honour SOURCE_DATE_EPOCH yet, so it generates unreproducible results. The attached patch fixes this by replacing the usage of __DATE__ and __TIME__ by fixed date and time strings. Once applied, nxt-firmware can be built reproducibly in our current experimental framework. [1]: https://wiki.debian.org/ReproducibleBuilds Regards, -- Dhole
diff -Nru nxt-firmware-1.29-20120908+dfsg/debian/changelog nxt-firmware-1.29-20120908+dfsg/debian/changelog --- nxt-firmware-1.29-20120908+dfsg/debian/changelog 2016-12-23 09:05:10.000000000 +0100 +++ nxt-firmware-1.29-20120908+dfsg/debian/changelog 2017-01-02 10:04:49.000000000 +0100 @@ -1,3 +1,11 @@ +nxt-firmware (1.29-20120908+dfsg-3.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Use a fixed timestamp in the source code to get a reproducible firmware + image. + + -- Eduard Sanou <dh...@openmailbox.org> Mon, 02 Jan 2017 10:04:49 +0100 + nxt-firmware (1.29-20120908+dfsg-3) unstable; urgency=low * Move AppStream metadata to new location /usr/share/metainfo/. diff -Nru nxt-firmware-1.29-20120908+dfsg/debian/patches/fix-timestamp.patch nxt-firmware-1.29-20120908+dfsg/debian/patches/fix-timestamp.patch --- nxt-firmware-1.29-20120908+dfsg/debian/patches/fix-timestamp.patch 1970-01-01 01:00:00.000000000 +0100 +++ nxt-firmware-1.29-20120908+dfsg/debian/patches/fix-timestamp.patch 2017-01-02 10:04:49.000000000 +0100 @@ -0,0 +1,18 @@ +Description: Fix timestamp + Use a fixed timestamp in the source code to get a reproducible firmware image. +Author: Eduard Sanou <dh...@openmailbox.org> + +--- nxt-firmware-1.29-20120908+dfsg.orig/AT91SAM7S256/Source/BtTest.inc ++++ nxt-firmware-1.29-20120908+dfsg/AT91SAM7S256/Source/BtTest.inc +@@ -9,8 +9,9 @@ + + extern void BtIo(void); + +-const char BUILD_DATE[] = __DATE__; +-const char BUILD_TIME[] = __TIME__; ++// Using fixed date and time to get reproducible builds ++const char BUILD_DATE[] = "Oct 19 2016"; ++const char BUILD_TIME[] = "10:27:42"; + + const char MONTH[] = "JanFebMarAprMayJunJulAugSepOctNovDec"; + diff -Nru nxt-firmware-1.29-20120908+dfsg/debian/patches/series nxt-firmware-1.29-20120908+dfsg/debian/patches/series --- nxt-firmware-1.29-20120908+dfsg/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ nxt-firmware-1.29-20120908+dfsg/debian/patches/series 2017-01-02 10:04:49.000000000 +0100 @@ -0,0 +1 @@ +fix-timestamp.patch