Skip to contentSkip to conversation

Makefile: remove block from conv=block, sync in SPL alignment dd

PATCH In review Brad Klingerman 3 participants 4 messages May 1 – May 8 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: remove block from conv=block, sync in SPL alignment dd

The line that produces $(SPL_BIN)-align.bin invokes dd with conv=block,sync but no cbs= operand. The result of dd conv=block without cbs= is unspecified. GNU coreutils outputs anyway, but uutils (default in Ubuntu 26.04 LTS) errors out for files with newlines, including SPL binaries, producing:

dd: conv=block or conv=ubnblock specified without cbs=N

Either the block operand must be removed, or cbs=N must be added. conv=block is for converting newline-terminated variable-length records to fixed-length space-padded ones, which is meaningless for a binary SPL image. The intent of the rule is 4-byte alignment, which conv=sync alone provides by padding the final block to bs= bytes with NULs.

During build, u-boot-spl-align.bin errors silently due to '@'.

Reproduced with uutils dd 0.8.0:

    $ dd if=/dev/urandom of=/tmp/in bs=1 count=10000
    $ dd if=/tmp/in of=/tmp/out conv=block,sync bs=4
    dd: conv=block or conv=unblock specified without cbs=N
    $ dd if=/tmp/in of=/tmp/out conv=sync bs=4
    [succeeds]

Output is byte-identical to GNU dd's output for binary input.

---
 scripts/Makefile.xpl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.xpl +1 -1
index 862a8e6f231..a3fd3e1375f 100644
@@ -257,7 +257,7 @@ MKIMAGEFLAGS_boot.bin = -T zynqmpimage -R $(srctree)/$(CONFIG_BOOT_INIT_FILE) \
 endif
 
 $(obj)/$(SPL_BIN)-align.bin: $(obj)/$(SPL_BIN).bin
-	@dd if=$< of=$@ conv=block,sync bs=4 2>/dev/null;
+	@dd if=$< of=$@ conv=sync bs=4 2>/dev/null;
 
 spl/boot.bin: $(obj)/$(SPL_BIN)-align.bin FORCE
 	$(call if_changed,mkimage)
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Brad Klingerman

Makefile: remove block from conv=block, sync in SPL alignment dd

The line that produces $(SPL_BIN)-align.bin invokes dd with conv=block,sync but no cbs= operand. The result of dd conv=block without cbs= is unspecified. GNU coreutils outputs anyway, but uutils (default in Ubuntu 26.04 LTS) errors out for files with newlines, including SPL binaries, producing:

dd: conv=block or conv=ubnblock specified without cbs=N

Either the block operand must be removed, or cbs=N must be added. conv=block is for converting newline-terminated variable-length records to fixed-length space-padded ones, which is meaningless for a binary SPL image. The intent of the rule is 4-byte alignment, which conv=sync alone provides by padding the final block to bs= bytes with NULs.

During build, u-boot-spl-align.bin errors silently due to '@'.

Reproduced with uutils dd 0.8.0:

    $ dd if=/dev/urandom of=/tmp/in bs=1 count=10000
    $ dd if=/tmp/in of=/tmp/out conv=block,sync bs=4
    dd: conv=block or conv=unblock specified without cbs=N
    $ dd if=/tmp/in of=/tmp/out conv=sync bs=4
    [succeeds]
Quoted 6 lines

Output is byte-identical to GNU dd's output for binary input.

scripts/Makefile.xpl | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH] Makefile: remove block from conv=block,sync in SPL alignment dd

In reply to Brad Klingerman
Quoted 25 lines · Brad Klingerman

The line that produces $(SPL_BIN)-align.bin invokes dd with conv=block,sync but no cbs= operand. The result of dd conv=block without cbs= is unspecified. GNU coreutils outputs anyway, but uutils (default in Ubuntu 26.04 LTS) errors out for files with newlines, including SPL binaries, producing:

dd: conv=block or conv=ubnblock specified without cbs=N

Either the block operand must be removed, or cbs=N must be added. conv=block is for converting newline-terminated variable-length records to fixed-length space-padded ones, which is meaningless for a binary SPL image. The intent of the rule is 4-byte alignment, which conv=sync alone provides by padding the final block to bs= bytes with NULs.

During build, u-boot-spl-align.bin errors silently due to '@'.

Reproduced with uutils dd 0.8.0:

    $ dd if=/dev/urandom of=/tmp/in bs=1 count=10000
    $ dd if=/tmp/in of=/tmp/out conv=block,sync bs=4
    dd: conv=block or conv=unblock specified without cbs=N
    $ dd if=/tmp/in of=/tmp/out conv=sync bs=4
    [succeeds]
Quoted 3 lines

Output is byte-identical to GNU dd's output for binary input.

Signature · 1 line
Tom
#3 lore raw
In reply to Brad Klingerman
Quoted 9 lines · Brad Klingerman

The line that produces $(SPL_BIN)-align.bin invokes dd with conv=block,sync but no cbs= operand. The result of dd conv=block without cbs= is unspecified. GNU coreutils outputs anyway, but uutils (default in Ubuntu 26.04 LTS) errors out for files with newlines, including SPL binaries, producing:

dd: conv=block or conv=ubnblock specified without cbs=N

[...]

Applied to u-boot/master, thanks!

[1/1] Makefile: remove block from conv=block, sync in SPL alignment dd

      commit: 26b17dbdb0f19efa67365b30d939d3572871e8ca
Signature · 1 line
Tom