Skip to contentSkip to conversation

Set time and umask on multi-dtb fit images to ensure reproducibile builds.

PATCH In review Vagrant Cascadian 2 participants 2 messages Jun 3, 2018 – Jun 4, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Set time and umask on multi-dtb fit images to ensure reproducibile builds.

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

---

 scripts/Makefile.spl | 4 ++++
 1 file changed, 4 insertions(+)
scripts/Makefile.spl +4 -0
index 057389997d..ef018b5b40 100644
@@ -391,6 +391,10 @@ 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)
+ifneq ($(SOURCE_DATE_EPOCH),)
+	touch -d @$(SOURCE_DATE_EPOCH) $(obj)/$(SPL_BIN).multidtb.fit
+	chmod 0600 $(obj)/$(SPL_BIN).multidtb.fit
+endif
 
 $(obj)/$(SPL_BIN).multidtb.fit.gz: $(obj)/$(SPL_BIN).multidtb.fit
 	@gzip -kf9 $< > $@
Signature · 1 line
2.11.0
#1 lore raw
Quoted 6 lines · Vagrant Cascadian

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.

Quoted 6 lines

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

https://bugs.debian.org/896520

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180604/125a03dc/attachment.sig>