[OpenWrt-Devel] [PATCH 13/13] Makefile: fix --mtime usage with SOURCE_DATE_EPOCH fixup

Alexander Couzens lynxis at fe80.eu
Mon Jan 25 15:49:35 EST 2016


---
 include/image.mk           | 4 ++--
 include/kernel-build.mk    | 2 +-
 scripts/sysupgrade-nand.sh | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 044dd1a..bfdfab9 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -188,7 +188,7 @@ ifneq ($(CONFIG_NAND_SUPPORT),)
 	[ -z "$(3)" ] || $(CP) "$(3)" "$(KDIR_TMP)/sysupgrade-$(1)/kernel"
 	(cd "$(KDIR_TMP)"; $(TAR) cvf \
 		"$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" sysupgrade-$(1) \
-			$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)")
+			$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)")
    endef
 
 # $(1) board name
@@ -251,7 +251,7 @@ endef
 
 define Image/mkfs/targz
 	$(TAR) -cp --numeric-owner --owner=0 --group=0 --sort=name \
-		$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
+		$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
 		-C $(TARGET_DIR)/ . | gzip -9n > $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz
 endef
 
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 39bdd01..7b951ba 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -57,7 +57,7 @@ ifdef CONFIG_COLLECT_KERNEL_DEBUG
 		$(KERNEL_BUILD_DIR)/debug/modules/
 	$(FIND) $(KERNEL_BUILD_DIR)/debug -type f | $(XARGS) $(KERNEL_CROSS)strip --only-keep-debug
 	$(TAR) c -C $(KERNEL_BUILD_DIR) debug \
-		$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
+		$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
 		| bzip2 -c -9 > $(BIN_DIR)/kernel-debug.tar.bz2
   endef
 endif
diff --git a/scripts/sysupgrade-nand.sh b/scripts/sysupgrade-nand.sh
index 73881e0..45b17da 100755
--- a/scripts/sysupgrade-nand.sh
+++ b/scripts/sysupgrade-nand.sh
@@ -58,7 +58,7 @@ echo "BOARD=${board}" > "${tmpdir}/sysupgrade-${board}/CONTROL"
 
 mtime=""
 if [ -n "$SOURCE_DATE_EPOCH" ]; then
-	mtime="--mtime=${SOURCE_DATE_EPOCH}"
+	mtime="--mtime=@${SOURCE_DATE_EPOCH}"
 fi
 
 (cd "$tmpdir"; tar cvf sysupgrade.tar sysupgrade-${board} ${mtime})
-- 
2.7.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list