binman: Add length header attribute to dtb entry
authorStefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Fri, 19 Aug 2022 14:25:25 +0000 (16:25 +0200)
committerSimon Glass <sjg@chromium.org>
Sun, 21 Aug 2022 00:07:33 +0000 (18:07 -0600)
commit6aa8000e7400c3861d7ede0ee4e206e19085116e
treea8092c94e7412922795af7a636f513136815df3e
parent204a27bbb222c61bf5aaecbf7e00a5a8aa835bf9
binman: Add length header attribute to dtb entry

Add an optional length header attribute to the device tree blob entry
class based on the compressed data header from the utilities to compress
and decompress data.

If needed the header could be enabled with the following
attribute beside the compress attribute:
  prepend = "length";

The header was introduced as part of commit eb0f4a4cb402 ("binman:
Support replacing data in a cbfs") to allow device tree entries to be
larger than the compressed contents. Regarding the commit "this is
necessary to cope with a compressed device tree being updated in such a
way that it shrinks after the entry size is already set (an obscure
case)". This case need to be fixed without influence any compressed data
by itself.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/binman/entries.rst
tools/binman/etype/blob_dtb.py
tools/binman/ftest.py
tools/binman/test/235_compress_dtb_prepend_invalid.dts [new file with mode: 0644]
tools/binman/test/236_compress_dtb_prepend_length.dts [new file with mode: 0644]