aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2017-06-18 21:30:30 +0200
committerAlexander Couzens <lynxis@fe80.eu>2017-06-25 12:11:41 +0200
commitd6331d5583d17e4cf9f67906449cb11dcef4007c (patch)
treef2d7ede95aa1593d30aed1299d2462fe379f1677 /target/linux
parent6adc757097ca966796ac213ba7f888d59b651661 (diff)
downloadupstream-d6331d5583d17e4cf9f67906449cb11dcef4007c.tar.gz
upstream-d6331d5583d17e4cf9f67906449cb11dcef4007c.tar.bz2
upstream-d6331d5583d17e4cf9f67906449cb11dcef4007c.zip
ar71xx/image: make tar calls reproducible
Use --mtime when SOURCE_DATE_EPOCH is set. Use gzip -n9z instead of tar z to remove timestamp in gzip header. Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ar71xx/image/legacy.mk9
-rw-r--r--target/linux/ar71xx/image/senao.mk5
2 files changed, 11 insertions, 3 deletions
diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk
index a9f535f064..919ac7e174 100644
--- a/target/linux/ar71xx/image/legacy.mk
+++ b/target/linux/ar71xx/image/legacy.mk
@@ -589,7 +589,10 @@ define Image/Build/ALFA
cd $(KDIR)/$(1); \
cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/$(1)/$(7); \
cp $(KDIR)/root.$(1) $(KDIR)/$(1)/$(8); \
- $(TAR) zcf $(call factoryname,$(1),$(2)) -C $(KDIR)/$(1) $(7) $(8); \
+ $(TAR) c \
+ $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+ -C $(KDIR)/$(1) $(7) $(8) \
+ | gzip -9nc > $(call factoryname,$(1),$(2)); \
( \
echo WRM7222C | dd bs=32 count=1 conv=sync; \
echo -ne '\xfe'; \
@@ -611,7 +614,9 @@ define Image/Build/Senao
of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-root.$(1) bs=64k conv=sync
( \
cd $(KDIR_TMP)/$(2)/; \
- $(TAR) -cz -f $(call factoryname,$(1),$(2)) * \
+ $(TAR) -c \
+ $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+ * | gzip -9nc > $(call factoryname,$(1),$(2)) \
)
-rm -rf $(KDIR_TMP)/$(2)/
-sh $(TOPDIR)/scripts/combined-image.sh \
diff --git a/target/linux/ar71xx/image/senao.mk b/target/linux/ar71xx/image/senao.mk
index 46ea9703fa..0c56aa49b3 100644
--- a/target/linux/ar71xx/image/senao.mk
+++ b/target/linux/ar71xx/image/senao.mk
@@ -8,7 +8,10 @@ define Build/senao-factory-image
$(CP) $(IMAGE_KERNEL) $@.senao/openwrt-senao-$(board)-uImage-lzma.bin
$(CP) $(rootfs) $@.senao/openwrt-senao-$(board)-root.squashfs
- $(TAR) -czf $@ -C $@.senao .
+ $(TAR) -c \
+ $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+ -C $@.senao . | gzip -9nc > $@
+
rm -rf $@.senao
endef