image: make kernel UBIFS images reproducible

The temporary directory used to create a kernel UBIFS image and its
kernel file receive wall-clock mtimes. mkfs.ubifs preserves these
times, making images differ between builds.

Set their timestamps to SOURCE_DATE_EPOCH before invoking mkfs.ubifs.

Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Robert Marko committed 2026-10-03 11:53:09 +02:00
1 parent 3bab3a63a1
commit fcc5cb880e
1 file changed
+3
+3
View File
@@ -30,6 +30,9 @@ endef
define Build/package-kernel-ubifs
mkdir $@.kernelubifs
cp $@ $@.kernelubifs/kernel
$(if $(SOURCE_DATE_EPOCH), \
touch -hcd "@$(SOURCE_DATE_EPOCH)" \
$@.kernelubifs $@.kernelubifs/kernel)
$(STAGING_DIR_HOST)/bin/mkfs.ubifs \
$(KERNEL_UBIFS_OPTS) \
-r $@.kernelubifs $@