Parcourir la source

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 <[email protected]>
Sungbo Eo il y a 4 ans
Parent
commit
e42764cc5f
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      include/image-commands.mk

+ 1 - 2
include/image-commands.mk

@@ -541,8 +541,7 @@ define Build/zip
 	rm -rf [email protected]
 	rm -rf [email protected]
 	mkdir [email protected]
 	mkdir [email protected]
 	mv $@ [email protected]/$(word 1,$(1))
 	mv $@ [email protected]/$(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)") \
 		$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
 		$(wordlist 2,$(words $(1)),$(1)) \
 		$(wordlist 2,$(words $(1)),$(1)) \
 		$@ [email protected]/$(if $(word 1,$(1)),$(word 1,$(1)),$$(basename $@))
 		$@ [email protected]/$(if $(word 1,$(1)),$(word 1,$(1)),$$(basename $@))