From fc166c4869dba4876ad3d7d6e12a8ff87c35ca2a Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 21 Sep 2026 21:06:40 +0200 Subject: [PATCH] imx: fix the boot file system of the Gateworks Ventana Build/boot-overlay copies the device trees and builds the boot script in $@.boot, so every file carries the build time. mkfs.ubifs writes st_mtime straight into the inode and has no SOURCE_DATE_EPOCH support, and the two tar calls pass neither --sort=name nor the options that pin the owner and the mode, so both nand.ubi and bootfs.tar.gz differ between builds. The diffoscope of the published bootfs.tar.gz shows both: wall clock mtimes on the device tree files, and a member order that follows readdir. Set the times in $@.boot once, before the UBIFS image and the tar are made. Sort the members of both archives and give them a fixed owner and mode, as the other archive recipes do. Signed-off-by: John Crispin --- target/linux/imx/image/cortexa9.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/linux/imx/image/cortexa9.mk b/target/linux/imx/image/cortexa9.mk index 6a3cbe038c6..d01845cbfcb 100644 --- a/target/linux/imx/image/cortexa9.mk +++ b/target/linux/imx/image/cortexa9.mk @@ -22,12 +22,15 @@ define Build/boot-overlay -d ./bootscript-$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \ $@.boot/6x_bootscript-$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) + $(if $(SOURCE_DATE_EPOCH),find $@.boot -exec touch -hcd "@$(SOURCE_DATE_EPOCH)" {} +) + $(STAGING_DIR_HOST)/bin/mkfs.ubifs \ --space-fixup --compr=zlib --squash-uids \ $(MKUBIFS_OPTS) -c 16248 \ -o $@.boot.ubifs -d $@.boot - $(TAR) -C $@.boot -cf $@.boot.tar . + $(TAR) -C $@.boot -cf $@.boot.tar \ + --sort=name --numeric-owner --owner=0 --group=0 --mode=go-w . endef define Build/bootfs.tar.gz @@ -36,7 +39,8 @@ define Build/bootfs.tar.gz $(TAR) -C $@.boot -xf $(IMAGE_KERNEL).boot.tar $(TAR) -C $@.boot \ - --numeric-owner --owner=0 --group=0 --transform "s,./,./boot/," \ + --sort=name --numeric-owner --owner=0 --group=0 --mode=go-w \ + --transform "s,./,./boot/," \ -czvf $@ . endef