binman: Add support for adding a name prefix to entries
Sometimes we have several sections which repeat the same entries (e.g. for
a read-only and read-write version of the same section). It is useful to
be able to tell these entries apart by name.
Add a new 'name-prefix' property for sections, which causes all entries
within that section to have a given name prefix.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 61bbb53..eb8a079 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -950,5 +950,15 @@
00000000 00000004 u-boot
''', map_data)
+ def testNamePrefix(self):
+ """Tests that name prefixes are used"""
+ _, _, map_data = self._DoReadFileDtb('56_name_prefix.dts', map=True)
+ self.assertEqual('''Position Size Name
+00000000 00000010 section@0
+ 00000000 00000004 ro-u-boot
+00000010 00000010 section@1
+ 00000000 00000004 rw-u-boot
+''', map_data)
+
if __name__ == "__main__":
unittest.main()