home: hub: mkinitfs

Download patch

ref: 7162f36c77bf145fbbd9bf48f27e8777b38bd757
parent: c0bc08e1e61fd53f6e2a51d011fe5751f1a1453b
author: kpcyrd <git@rxv.cc>
date: Sat Jun 26 16:40:42 CDT 2021

Normalize mtimes in cpio

See https://twitter.com/sn0int/status/1408853993774845952

--- a/mkinitfs.in
+++ b/mkinitfs.in
@@ -167,6 +167,12 @@
 		return
 	fi
 	rm -f $outfile
+
+	if [ -n "$SOURCE_DATE_EPOCH" ]; then
+		# normalize timestamps
+		find "$tmpdir" -exec touch -h -d "@$SOURCE_DATE_EPOCH" {} +
+	fi
+
 	umask 0077
 	(cd "$tmpdir" && find . | sort | cpio --quiet -o -H newc | $comp) > $outfile
 }