diff mbox series

[U-Boot,3/3] Set time and umask on fit-dtb.blob to ensure reproducibile builds.

Message ID 20190502004217.20863-4-vagrant@reproducible-builds.org
State Superseded
Delegated to: Tom Rini
Headers show
Series Tidy up support for compressed fit-dtb.blob. | expand

Commit Message

Vagrant Cascadian May 2, 2019, 12:42 a.m. UTC
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:


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

 Makefile | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series


diff --git a/Makefile b/Makefile
index 68f2327bea..cff5ea4c5f 100644
--- a/Makefile
+++ b/Makefile
@@ -1047,6 +1047,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
 MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
 	-a 0 -e 0 -E \