[U-Boot] [PATCH 44/53] binman: Support replacing data in a cbfs

sjg at google.com sjg at google.com
Mon Jul 29 21:22:01 UTC 2019


At present binman cannot replace data within a CBFS since it does not
allow rewriting of the files in that CBFS. Implement this by using the
new WriteData() method to handle the case.

Add a header to compressed data so that the amount of compressed data can
be determined without reference to the size of the containing entry. This
allows the entry to be larger that the contents, without causing errors in
decompression. 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). It is not used with CBFS since it has its
own metadata for this. Increase the number of passes allowed to resolve
the position of entries, to handle this case.

Add a test for this new logic.

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

 tools/binman/cbfs_util.py              | 10 ++++---
 tools/binman/control.py                |  2 +-
 tools/binman/entry_test.py             |  5 ++++
 tools/binman/etype/cbfs.py             |  3 ++-
 tools/binman/ftest.py                  | 26 +++++++++++++++++-
 tools/binman/test/142_replace_cbfs.dts | 37 ++++++++++++++++++++++++++
 tools/patman/tools.py                  | 11 ++++++--
 7 files changed, 85 insertions(+), 9 deletions(-)
 create mode 100644 tools/binman/test/142_replace_cbfs.dts

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list