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/ .
This commit is contained in:
Rasmus Villemoes
2024-11-06 14:16:51 +01:00
committed by Tim Gover
parent c873eecc28
commit c6b8de409d

View File

@@ -92,7 +92,11 @@ writeSig() {
sha256sum "${IMAGE}" | awk '{print $1}' > "${OUTPUT}" sha256sum "${IMAGE}" | awk '{print $1}' > "${OUTPUT}"
# Include the update-timestamp # Include the update-timestamp
echo "ts: $(date -u +%s)" >> "${OUTPUT}" if [ -n "${SOURCE_DATE_EPOCH}" ] ; then
echo "ts: ${SOURCE_DATE_EPOCH}" >> "${OUTPUT}"
else
echo "ts: $(date -u +%s)" >> "${OUTPUT}"
fi
if [ -n "${KEY}" ]; then if [ -n "${KEY}" ]; then
[ -f "${KEY}" ] || die "RSA private \"${KEY}\" not found" [ -f "${KEY}" ] || die "RSA private \"${KEY}\" not found"