scripts/gen_image_generic.sh: make ext4 bootfs reproducible
authorDaniel Golle <daniel@makrotopia.org>
Mon, 28 Mar 2022 17:13:45 +0000 (18:13 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 15 Apr 2022 13:11:49 +0000 (14:11 +0100)
Set fixed timestamp for kernel other files in /boot filesystem.
This should help making x86 *combined* images reproducible.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 068ea2cde04e2666fb05731cea941bccfaeddc25)

scripts/gen_image_generic.sh

index 17888eac60bf5d7ba15926bf6c267bf1267ec3a3..6a01c813d772329a185c3f13ecb23db152a05675 100755 (executable)
@@ -34,7 +34,7 @@ if [ -n "$GUID" ]; then
     mkfs.fat -n kernel -C "$OUTPUT.kernel" -S 512 "$((KERNELSIZE / 1024))"
     mcopy -s -i "$OUTPUT.kernel" "$KERNELDIR"/* ::/
 else
-    make_ext4fs -J -L kernel -l "$KERNELSIZE" "$OUTPUT.kernel" "$KERNELDIR"
+    make_ext4fs -J -L kernel -l "$KERNELSIZE" ${SOURCE_DATE_EPOCH:+-T ${SOURCE_DATE_EPOCH}} "$OUTPUT.kernel" "$KERNELDIR"
 fi
 dd if="$OUTPUT.kernel" of="$OUTPUT" bs=512 seek="$KERNELOFFSET" conv=notrunc
 rm -f "$OUTPUT.kernel"