]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Set time and umask on fit-dtb.blob to ensure reproducibile builds.
authorVagrant Cascadian <vagrant@reproducible-builds.org>
Thu, 2 May 2019 18:14:12 +0000 (11:14 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 10 May 2019 00:22:04 +0000 (20:22 -0400)
Support for compressed fit-dtb.blob was added in:

  commit 95f4bbd581cf ("lib: fdt: Allow LZO and GZIP DT compression in
  U-Boot")

When building compressed (lzop, gzip) fit-dtb.blob 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

This is essentially the same fix applied to multi-dtb fit SPL images in:

  commit 8664ab7debab ("Set time and umask on multi-dtb fit images to
  ensure reproducibile builds.")

Signed-off-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
Makefile

index d1224764abe7df51aa90e601aff975fc1288b68f..afe3bbeaca0d6a6de0fddeea8537aaba86944659 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1058,6 +1058,10 @@ fit-dtb.blob.lzo: fit-dtb.blob
 
 fit-dtb.blob: dts/dt.dtb FORCE
        $(call if_changed,mkimage)
+ifneq ($(SOURCE_DATE_EPOCH),)
+       touch -d @$(SOURCE_DATE_EPOCH) fit-dtb.blob
+       chmod 0600 fit-dtb.blob
+endif
 
 MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
        -a 0 -e 0 -E \