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>
This commit is contained in:
Simon Glass
2018-06-01 09:38:21 -06:00
parent 3b0c3821d6
commit c8d48efb2b
5 changed files with 66 additions and 3 deletions

View File

@@ -950,5 +950,15 @@ class TestFunctional(unittest.TestCase):
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()