[OpenWrt-Devel,6/8] mvebu: image: rework uDPU-firmware recipe
diff mbox series

Message ID 20200131154620.25773-7-tomek_n@o2.pl
State Superseded
Headers show
Series
  • mvebu: Second round of clean-ups
Related show

Commit Message

Tomasz Maciej Nowak Jan. 31, 2020, 3:46 p.m. UTC
Tar has ability to change current dir, so use that instead additional
command invocation. Also being here, change tar arguments to make final
archive reproducible.

Cc: Scott Roberts <ttocsr@gmail.com>
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
---
 target/linux/mvebu/image/Makefile | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index ae4d3b9594..5a19b0559d 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -70,9 +70,15 @@  define Build/uDPU-firmware
 	(rm -fR $@-fw; mkdir -p $@-fw)
 	$(CP) $(BIN_DIR)/$(IMAGE_PREFIX)-initramfs.itb $@-fw/recovery.itb
 	$(CP) $@-boot.scr $@-fw/boot.scr
-	(cd $(TARGET_DIR); $(TAR) -cvzf $@-fw/rootfs.tgz .)
-	(cd $@.boot; $(TAR) -cvzf $@-fw/boot.tgz .)
-	(cd $@-fw; $(TAR) -cvzf $(KDIR_TMP)/$(IMAGE_PREFIX)-firmware.tgz .)
+	$(TAR) -cvzp --numeric-owner --owner=0 --group=0 --sort=name \
+		$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+		-f $@-fw/rootfs.tgz -C $(TARGET_DIR) .
+	$(TAR) -cvzp --numeric-owner --owner=0 --group=0 --sort=name \
+		$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+		-f $@-fw/boot.tgz -C $@.boot .
+	$(TAR) -cvzp --numeric-owner --owner=0 --group=0 --sort=name \
+		$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+		-f $(KDIR_TMP)/$(IMAGE_PREFIX)-firmware.tgz -C $@-fw .
 endef
 
 DEVICE_VARS += BOOT_SCRIPT UBOOT