Skip to contentSkip to conversation

Tidy up support for compressed fit-dtb.blob.

PATCH New Vagrant Cascadian 2 participants 7 messages May 2, 2019 – May 10, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

v2 cover Tidy up support for compressed fit-dtb.blob.

Support for compressed fit-dtb.blob was added in:

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

This introduces reproducibility issues as the timestamp and umask may be embedded in the output when using gzip, lzop or possibly other compression tools if added later. The included patch works around this by setting the date and umask on the file when SOURCE_DATE_EPOCH is set.

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.")

The compressed files were not added to gitignore or the clean targets, and the other two patches in this series adds them.

Changes in v2:
- Mention commit where compressed fit-dtb.blob were introduced.
- Mention commit where compressed fit-dtb.blob were introduced.
- Add reference to similar fix in multi-dtb fit SPL images
- Mention commit where compressed fit-dtb.blob were introduced.

Vagrant Cascadian (3):
Add fit-dtb.blob* to .gitignore.
Remove fit-dtb.blob* in clean target.
Set time and umask on fit-dtb.blob to ensure reproducibile builds.

 .gitignore | 2 +-
 Makefile   | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/3 Add fit-dtb.blob* to .gitignore.

Support for compressed fit-dtb.blob was added in:

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

Adjust .gitignore to also exclude compressed blobs.

---

Changes in v2:
- Mention commit where compressed fit-dtb.blob were introduced.

 .gitignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitignore +1 -1
index c2afcfbca2..d8b7b77844 100644
@@ -35,7 +35,7 @@
 #
 # Top-level generic files
 #
-fit-dtb.blob
+fit-dtb.blob*
 /MLO*
 /SPL*
 /System.map
Signature · 1 line
2.20.1
#2 lore raw

PATCH v2 1/3 Add fit-dtb.blob* to .gitignore.

Quoted 8 lines · Vagrant Cascadian

Support for compressed fit-dtb.blob was added in:

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

Adjust .gitignore to also exclude compressed blobs.

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/20190510/d55a8422/attachment.sig>
#3 lore raw

PATCH v2 2/3 Remove fit-dtb.blob* in clean target.

In reply to Vagrant Cascadian

Support for compressed fit-dtb.blob was added in:

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

Adjust Makefile to also clean compressed blobs.

---

Changes in v2:
- Mention commit where compressed fit-dtb.blob were introduced.

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index d6a6ef19ab..68f2327bea 100644
@@ -1779,7 +1779,7 @@ CLEAN_DIRS  += $(MODVERDIR) \
 			$(filter-out include, $(shell ls -1 $d 2>/dev/null))))
 
 CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \
-	       boot* u-boot* MLO* SPL System.map fit-dtb.blob
+	       boot* u-boot* MLO* SPL System.map fit-dtb.blob*
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
Signature · 1 line
2.20.1
#4 lore raw

PATCH v2 2/3 Remove fit-dtb.blob* in clean target.

Quoted 8 lines · Vagrant Cascadian

Support for compressed fit-dtb.blob was added in:

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

Adjust Makefile to also clean compressed blobs.

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/20190510/26811ea8/attachment.sig>
#5 lore raw

PATCH v2 3/3 Set time and umask on fit-dtb.blob to ensure reproducibile builds.

In reply to Vagrant Cascadian

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.")

---

Changes in v2:
- Add reference to similar fix in multi-dtb fit SPL images
- Mention commit where compressed fit-dtb.blob were introduced.

 Makefile | 4 ++++
 1 file changed, 4 insertions(+)
Makefile +4 -0
index 68f2327bea..cff5ea4c5f 100644
@@ -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
+endif
 
 MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
 	-a 0 -e 0 -E \
Signature · 1 line
2.20.1
#6 lore raw

PATCH v2 3/3 Set time and umask on fit-dtb.blob to ensure reproducibile builds.

Quoted 14 lines · Vagrant Cascadian

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:

Quoted 8 lines

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.")

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/20190510/ac66698d/attachment.sig>