mvebu: image: rework uDPU-firmware recipe
authorTomasz Maciej Nowak <tomek_n@o2.pl>
Mon, 10 Feb 2020 15:33:25 +0000 (16:33 +0100)
committerPetr Štetiar <ynezz@true.cz>
Sun, 1 Mar 2020 20:36:00 +0000 (21:36 +0100)
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

index d73f3e20fcc1585abe1947b10a7154f5f5ca1ac6..024e77969ac4ce5505aeed50e931000686001ef7 100644 (file)
@@ -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
 
 define Device/Default