Source: jh7100-bootloader-recovery
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

The build date is embedded in jh7100_recovery_boot.bin:

  
https://tests.reproducible-builds.org/debian/rb-pkg/bookworm/amd64/diffoscope-results/jh7100-bootloader-recovery.html

  /usr/lib/firmware/jh71xx/jh7100_recovery_boot.bin

  000050d0:·6465·6275·6700·0000·3232·3130·3232·2d30··debug...221022-0
  vs.
  000050d0:·6465·6275·6700·0000·3233·3131·3235·2d30··debug...231125-0

The attached patch to the upstream Makefile fixes this by using the
SOURCE_DATE_EPOCH environment variable.

Alternately, if possible, removing the date entirely would be even
better!

According to my local tests, With this patch applied jh7100-bootloader-recovery 
should
build reproducibly on tests.reproducible-builds.org!

Thanks for maintaining jh7100-bootloader-recovery!

live well,
  vagrant
From 4c99cf32973187a1f4a024a7ea97ca44b738c347 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Sun, 20 Nov 2022 23:25:11 +0000
Subject: [PATCH] Makefile: Use SOURCE_DATE_EPOCH to set SUFFIX available.

https://reproducible-builds.org/docs/source-date-epoch/
---
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index dfe8087..be351de 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,12 @@ EMPTY  :=
 SPACE  := $(EMPTY) $(EMPTY)
 PROGRAM = jh7100_recovery_boot
 
-SUFFIX=$(shell date +%y%m%d)
+DATE_FMT = +%y-%m-%d
+ifdef SOURCE_DATE_EPOCH
+    SUFFIX ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
+else
+    SUFFIX ?= $(shell date "$(DATE_FMT)")
+endif
 GIT_VERSION=$(shell git show -s --pretty=format:%h)
 DEB_VERSION=$(shell dpkg-parsechangelog --show-field Version)
 VERSION=$(SUFFIX)-$(DEB_VERSION)
-- 
2.38.1

Attachment: signature.asc
Description: PGP signature

Reply via email to