diff options
| author | Robert Marko | 2026-10-02 12:00:40 +0000 |
|---|---|---|
| committer | Robert Marko | 2026-10-02 12:12:05 +0000 |
| commit | a613eedde0eb05222e28e0c8d017b082d03f5f4d (patch) | |
| tree | fda70cbff75ec0bdd42adc60d5ff8a461799f828 | |
| parent | 51a488a7c63259b0dd5e33888cd41c5ed6db4edd (diff) | |
uboot-fritz4040: make build timestamp reproducible
The FRITZ!Box 4040 U-Boot build embeds the current date and time.
This changes the U-Boot payload and causes the EVA factory image to
differ between otherwise identical builds.
Use SOURCE_DATE_EPOCH to generate the timestamp when it is set, while
retaining the current-time fallback for non-reproducible builds.
Signed-off-by: Robert Marko <robimarko@gmail.com>
| -rw-r--r-- | package/boot/uboot-fritz4040/patches/100-reproducible-timestamp.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/package/boot/uboot-fritz4040/patches/100-reproducible-timestamp.patch b/package/boot/uboot-fritz4040/patches/100-reproducible-timestamp.patch new file mode 100644 index 0000000000..09c244617b --- /dev/null +++ b/package/boot/uboot-fritz4040/patches/100-reproducible-timestamp.patch @@ -0,0 +1,31 @@ +From: Robert Marko <robimarko@gmail.com> +Subject: [PATCH] Make U-Boot timestamp reproducible + +Use SOURCE_DATE_EPOCH when it is set to avoid embedding the current date +and time in the generated U-Boot binary. + +Signed-off-by: Robert Marko <robimarko@gmail.com> +--- + Makefile | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -684,10 +684,15 @@ $(VERSION_FILE): + '$(shell $(LD) -v | head -n 1)' )>> $@.tmp + @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ + ++TIMESTAMP_DATE = date ++ifneq ($(SOURCE_DATE_EPOCH),) ++TIMESTAMP_DATE = date -u -d "@$(SOURCE_DATE_EPOCH)" ++endif ++ + $(TIMESTAMP_FILE): + @mkdir -p $(dir $(TIMESTAMP_FILE)) +- @LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@.tmp +- @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@.tmp ++ @LC_ALL=C $(TIMESTAMP_DATE) +'#define U_BOOT_DATE "%b %d %C%y"' > $@.tmp ++ @LC_ALL=C $(TIMESTAMP_DATE) +'#define U_BOOT_TIME "%T"' >> $@.tmp + @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ + + easylogo env gdb: |