From fcc5cb880e042b275b2d4f9d9a7287079126f414 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Fri, 2 Oct 2026 14:16:57 +0200 Subject: [PATCH] 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 --- include/image-commands.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/image-commands.mk b/include/image-commands.mk index 60ab73f4fa2..ea5e483b525 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 $@