[U-Boot] [PATCH 23/34] binman: Avoid needing the section size in advance

sjg at google.com sjg at google.com
Fri Sep 27 00:38:51 UTC 2019


Entries which include a section and need to obtain its contents call
GetData(), as with any other entry. But the current implementation of this
method in entry_Section requires the size of the section to be known. If
it is unknown, an error is produced, since size is None:

   TypeError: can't multiply sequence by non-int of type 'NoneType'

There is no need to know the size in advance since the code can be
adjusted to build up the section piece by piece, instead of patching each
entry into an existing bytearray.

Update the code to handle this and add a test.

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

 tools/binman/etype/section.py                 | 14 +++++---
 tools/binman/ftest.py                         |  6 ++++
 .../binman/test/151_x86_rom_ifwi_section.dts  | 33 +++++++++++++++++++
 3 files changed, 49 insertions(+), 4 deletions(-)
 create mode 100644 tools/binman/test/151_x86_rom_ifwi_section.dts

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list