[PATCH v6 08/21] binman: Add length header attribute to dtb entry

Simon Glass sjg at chromium.org
Sat Aug 20 23:33:37 CEST 2022


On Fri, 19 Aug 2022 at 08:26, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss at weidmueller.com> wrote:
>
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>
>
> 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 at weidmueller.com>
>
> ---
>
> (no changes since v5)
>
> Changes in v5:
> - Fix decompress
>
> Changes in v3:
> - Move comp_util.py changes (drop with_header) into separate commits.
>
> Changes in v2:
> - Reworked to make the feature optional.
>
>  tools/binman/entries.rst                      |  3 ++
>  tools/binman/etype/blob_dtb.py                | 27 +++++++++++++
>  tools/binman/ftest.py                         | 39 +++++++++++++++++++
>  .../test/235_compress_dtb_prepend_invalid.dts | 17 ++++++++
>  .../test/236_compress_dtb_prepend_length.dts  | 19 +++++++++
>  5 files changed, 105 insertions(+)
>  create mode 100644 tools/binman/test/235_compress_dtb_prepend_invalid.dts
>  create mode 100644 tools/binman/test/236_compress_dtb_prepend_length.dts
>

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list