summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Spooren2026-09-25 08:19:37 +0000
committerPaul Spooren2026-09-27 08:12:34 +0000
commit177bc19f275908572805e36d9e5debe8b32ef471 (patch)
treeeb7fccf92bf14c58b36915d473b14e9e39d731a2
parent220866c5cf36269c3099b955d7b0de3d080bcade (diff)
ath79: make the ZyXEL NWA11xx factory tarball reproducible
The factory images of the ZyXEL NWA11xx devices differ between builds in the tar.bz2 they wrap: -drwxr-xr-x 0 buildbot (1000) buildbot (1000) 0 2026-09-24 21:39:18 ./ -rw-r--r-- 0 buildbot (1000) buildbot (1000) 3387 2026-09-24 21:39:18 ./vmlinux_mi124_f1e.lzma.uImage -rw-r--r-- 0 buildbot (1000) buildbot (1000) 8388608 2026-09-24 21:39:18 ./mi124_f1e-jffs2 +drwxr-xr-x 0 rebuilder (1000) rebuilder (1000) 0 2026-09-25 01:03:01 ./ +-rw-r--r-- 0 rebuilder (1000) rebuilder (1000) 8388608 2026-09-25 01:03:01 ./mi124_f1e-jffs2 +-rw-r--r-- 0 rebuilder (1000) rebuilder (1000) 3387 2026-09-25 01:03:01 ./vmlinux_mi124_f1e.lzma.uImage zyxel-tar-bz2 archives the staging directory as it is, so owner, mtime and the order of the members come from the build host. Store the members as root with the mtime set to SOURCE_DATE_EPOCH and without group or other write permission. List them explicitly, kernel first, which is the order of the images built so far, instead of sorting them by name. Link: https://github.com/openwrt/openwrt/pull/25389 Signed-off-by: Paul Spooren <mail@aparcar.org>
-rw-r--r--target/linux/ath79/image/generic.mk5
1 files changed, 4 insertions, 1 deletions
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 040d6cbcd7..ee92fef1c3 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -162,7 +162,10 @@ define Build/zyxel-tar-bz2
mkdir -p $@.tmp
mv $@ $@.tmp/$(word 2,$(1))
cp $(KDIR)/loader-$(DEVICE_NAME).uImage $@.tmp/$(word 1,$(1)).lzma.uImage
- $(TAR) -cjf $@ -C $@.tmp .
+ $(TAR) -cjf $@ -C $@.tmp --no-recursion \
+ --numeric-owner --owner=0 --group=0 --mode=go-w \
+ $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+ . ./$(word 1,$(1)).lzma.uImage ./$(word 2,$(1))
rm -rf $@.tmp
endef