1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

binman: Add support for outputing a map file

It is useful to be able to see a list of regions in each image produced by
binman. Add a -m option to output this information in a '.map' file
alongside the image file.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2018-06-01 09:38:20 -06:00
parent 7ae5f315b3
commit 3b0c3821d6
8 changed files with 88 additions and 6 deletions

View File

@@ -98,3 +98,11 @@ class Image:
def GetEntries(self):
return self._section.GetEntries()
def WriteMap(self):
"""Write a map of the image to a .map file"""
filename = '%s.map' % self._name
fname = tools.GetOutputFilename(filename)
with open(fname, 'w') as fd:
print('%8s %8s %s' % ('Position', 'Size', 'Name'), file=fd)
self._section.WriteMap(fd, 0)