summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Marko2026-10-02 12:16:57 +0000
committerRobert Marko2026-10-03 09:53:09 +0000
commitfcc5cb880e042b275b2d4f9d9a7287079126f414 (patch)
treea365679afa032dcd3fadbfe81efb089d1fad9612
parent3bab3a63a18b6b759b5edc717c78dbbcbaaba0e2 (diff)
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>
-rw-r--r--include/image-commands.mk3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 60ab73f4fa..ea5e483b52 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -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 $@