Skip to content

Commit c6b8de4

Browse files
ravi-prevastimg236
authored andcommitted
rpi-eeprom-digest: honour SOURCE_DATE_EPOCH
If used in a build environment that sets SOURCE_DATE_EPOCH, we should honour that in order to generate reproducible binaries. See https://reproducible-builds.org/specs/source-date-epoch/ .
1 parent c873eec commit c6b8de4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rpi-eeprom-digest

+5-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ writeSig() {
9292
sha256sum "${IMAGE}" | awk '{print $1}' > "${OUTPUT}"
9393

9494
# Include the update-timestamp
95-
echo "ts: $(date -u +%s)" >> "${OUTPUT}"
95+
if [ -n "${SOURCE_DATE_EPOCH}" ] ; then
96+
echo "ts: ${SOURCE_DATE_EPOCH}" >> "${OUTPUT}"
97+
else
98+
echo "ts: $(date -u +%s)" >> "${OUTPUT}"
99+
fi
96100

97101
if [ -n "${KEY}" ]; then
98102
[ -f "${KEY}" ] || die "RSA private \"${KEY}\" not found"

0 commit comments

Comments
 (0)