[openwrt/openwrt] build: image: use UTC for zip timestamp

LEDE Commits lede-commits at lists.infradead.org
Wed Mar 9 01:14:19 PST 2022


mans0n pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e42764cc5fa364e9fa553903c56191484738965e

commit e42764cc5fa364e9fa553903c56191484738965e
Author: Sungbo Eo <mans0n at gorani.run>
AuthorDate: Sat Feb 12 17:01:31 2022 +0900

    build: image: use UTC for zip timestamp
    
    Zip uses DOS timestamp for mtime which is stored in local time and hence
    depends on the timezone of the build system. Force zip to use UTC timezone
    to make image builds more reproducible.
    
    Signed-off-by: Sungbo Eo <mans0n at gorani.run>
---
 include/image-commands.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 939f5ef2db..21f851d205 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -541,8 +541,7 @@ define Build/zip
 	rm -rf $@.tmp
 	mkdir $@.tmp
 	mv $@ $@.tmp/$(word 1,$(1))
-
-	$(STAGING_DIR_HOST)/bin/zip -j -X \
+	TZ=UTC $(STAGING_DIR_HOST)/bin/zip -j -X \
 		$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
 		$(wordlist 2,$(words $(1)),$(1)) \
 		$@ $@.tmp/$(if $(word 1,$(1)),$(word 1,$(1)),$$(basename $@))




More information about the lede-commits mailing list