binman: Include also subnodes in generator nodes
PATCH v2 1/1 binman: Include also subnodes in generator nodes
From: Jan Kiszka <[email protected]>
This allows to prefill fdt and config nodes with hash and signature subnodes. It's just important to place the child nodes last so that hashes do not come before the data - would be disliked by mkimage.
Signed-off-by Jan Kiszka <[email protected]>
---
Changes in v2:
- local var renamed
- added test case
tools/binman/etype/fit.py | 4 ++++ tools/binman/ftest.py | 1 + tools/binman/test/170_fit_fdt.dts | 3 +++ 3 files changed, 8 insertions(+)
tools/binman/etype/fit.py +4 -0
@@ -214,6 +214,10 @@ class Entry_fit(Entry_section): if depth == 1 and in_images: fsw.property('data', tools.read_file(fname)) + + for subsubnode in subnode.subnodes: + with fsw.add_node(subsubnode.name): + _AddNode(subnode, depth + 1, subsubnode) else: if self._fdts is None: if self._fit_list_prop:
tools/binman/ftest.py +1 -0
@@ -3915,6 +3915,7 @@ class TestFunctional(unittest.TestCase): self.assertEqual(expected_data, fnode.props['data'].bytes) self.assertEqual('fdt-test-fdt%d.dtb' % seq, fnode.props['description'].value) + self.assertEqual(fnode.subnodes[0].name, 'hash') def _CheckConfig(seq, expected_data): """Check the configuration nodes
tools/binman/test/170_fit_fdt.dts +3 -0
@@ -36,6 +36,9 @@ description = "fdt-NAME.dtb"; type = "flat_dt"; compression = "none"; + hash { + algo = "sha256"; + }; }; };
Signature · 1 line
2.34.1