]> git.baikalelectronics.ru Git - uboot.git/commit
binman: Avoid needing the section size in advance
authorSimon Glass <sjg@chromium.org>
Sat, 24 Aug 2019 13:23:03 +0000 (07:23 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 15 Oct 2019 14:40:02 +0000 (08:40 -0600)
commitd26d78651fda55b10a88e125ede9f956c5131860
tree5341bfacb7d46800bfc05ae29dd8bc726e13dc3e
parent8d924016481cee726dd432cbb9e68fa1cff2a168
binman: Avoid needing the section size in advance

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@chromium.org>
tools/binman/etype/section.py
tools/binman/ftest.py
tools/binman/test/151_x86_rom_ifwi_section.dts [new file with mode: 0644]