]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Include also subnodes in generator nodes
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 28 Feb 2022 16:06:20 +0000 (17:06 +0100)
committerSimon Glass <sjg@chromium.org>
Sat, 19 Mar 2022 01:24:24 +0000 (19:24 -0600)
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 <jan.kiszka@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/binman/etype/fit.py
tools/binman/ftest.py
tools/binman/test/170_fit_fdt.dts

index 2d4c5f65451b8c29c44dcc2d16e4a03a21d5a1fb..0ae696f9c25613055e20afef26cf975ff876994c 100644 (file)
@@ -269,6 +269,10 @@ class Entry_fit(Entry_section):
                         # Add data for 'images' nodes (but not 'config')
                         if depth == 1 and in_images:
                             fsw.property('data', tools.read_file(fname))
+
+                        for subnode in node.subnodes:
+                            with fsw.add_node(subnode.name):
+                                _add_node(node, depth + 1, subnode)
             else:
                 if self._fdts is None:
                     if self._fit_list_prop:
index 8d41ab67c50123c705e24c6d26b4dc72a92afc24..92d9dc0df921abb4977ef070ffcbc826dd3a51c4 100644 (file)
@@ -4029,6 +4029,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
index 99d710c57e9b1c49c223799c6fb01408a9720ddc..0197ffd15974348471a939ec2db4fa1e319636a5 100644 (file)
@@ -36,6 +36,9 @@
                                        description = "fdt-NAME.dtb";
                                        type = "flat_dt";
                                        compression = "none";
+                                       hash {
+                                               algo = "sha256";
+                                       };
                                };
                        };