set-time-and-umask-on-spl-fit-files
authorVagrant Cascadian <vagrant@debian.org>
Thu, 10 May 2018 20:24:57 +0000 (21:24 +0100)
committerVagrant Cascadian <vagrant@debian.org>
Thu, 10 May 2018 20:24:57 +0000 (21:24 +0100)
When building compressed (lzop, gzip) multi-dtb fit images, the
compression tool may embed the time or umask in the image.

Work around this by manually setting the time of the source file using
SOURCE_DATE_EPOCH and a hard-coded 0600 umask.

With gzip, this could be accomplished by using -n/--no-name, but lzop
has no current workaround:

  https://bugs.debian.org/896520

Gbp-Pq: Topic reproducible
Gbp-Pq: Name set-time-and-umask-on-spl-fit-files

scripts/Makefile.spl

index 09e7cef96ed0c38361f3ce0c1a0701891a168d43..7d6706eafede82eb8ddb035c6db896418026d3ac 100644 (file)
@@ -387,6 +387,8 @@ MKIMAGEFLAGS_$(SPL_BIN).multidtb.fit = -f auto -A $(ARCH) -T firmware -C none -O
 
 $(obj)/$(SPL_BIN).multidtb.fit: /dev/null $(SHRUNK_ARCH_DTB) FORCE
        $(call if_changed,mkimage)
+       touch -d @$(SOURCE_DATE_EPOCH) $(obj)/$(SPL_BIN).multidtb.fit
+       chmod 0600 $(obj)/$(SPL_BIN).multidtb.fit
 
 $(obj)/$(SPL_BIN).multidtb.fit.gz: $(obj)/$(SPL_BIN).multidtb.fit
        @gzip -kf9 $< > $@