aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-04-11 15:25:27 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-04-15 14:11:54 +0100
commit5e617186404ce578adf4ec3f2f1c90fd671c8f9b (patch)
treefb5f5288574ed525b947344ab6dd37f795f0f9b8
parenta376efae8f17a94b6c9eb04fa7ef05a5abf73397 (diff)
downloadupstream-5e617186404ce578adf4ec3f2f1c90fd671c8f9b.tar.gz
upstream-5e617186404ce578adf4ec3f2f1c90fd671c8f9b.tar.bz2
upstream-5e617186404ce578adf4ec3f2f1c90fd671c8f9b.zip
scripts/gen_image_generic.sh: generate reproducible EFI filesystem
Generate FAT filesystem for EFI boot in a reproducible way: * use '--invariant' option of mkfs.fat * set timestamps of all files to SOURCE_DATE_EPOCH * make sure files are ordered locale-independent Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit aece8f5ae8d15e5e79b8e34a176895209709afb6)
-rwxr-xr-xscripts/gen_image_generic.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh
index 6a01c813d7..5e37224736 100755
--- a/scripts/gen_image_generic.sh
+++ b/scripts/gen_image_generic.sh
@@ -31,8 +31,9 @@ dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc
if [ -n "$GUID" ]; then
[ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$((ROOTFSOFFSET + ROOTFSSIZE))" conv=notrunc count="$sect"
- mkfs.fat -n kernel -C "$OUTPUT.kernel" -S 512 "$((KERNELSIZE / 1024))"
- mcopy -s -i "$OUTPUT.kernel" "$KERNELDIR"/* ::/
+ mkfs.fat --invariant -n kernel -C "$OUTPUT.kernel" -S 512 "$((KERNELSIZE / 1024))"
+ [ "$SOURCE_DATE_EPOCH" ] && find "$KERNELDIR"/ -mindepth 1 -execdir touch -hcd "@${SOURCE_DATE_EPOCH}" "{}" +
+ LC_ALL=C mcopy -m -s -i "$OUTPUT.kernel" "$KERNELDIR"/* ::/
else
make_ext4fs -J -L kernel -l "$KERNELSIZE" ${SOURCE_DATE_EPOCH:+-T ${SOURCE_DATE_EPOCH}} "$OUTPUT.kernel" "$KERNELDIR"
fi