diff options
author | Simon Glass <sjg@chromium.org> | 2018-06-01 18:38:20 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-06-07 22:25:08 +0300 |
commit | 3b0c3821d6401106cc873a6c27a8ee31a8d466a4 (patch) | |
tree | 6cbc5ada5ea4b901002c756635b077767c27268c /tools/binman/image.py | |
parent | 7ae5f315b34454d1a993e7e96e94d26da6e28e6c (diff) | |
download | u-boot-3b0c3821d6401106cc873a6c27a8ee31a8d466a4.tar.xz |
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>
Diffstat (limited to 'tools/binman/image.py')
-rw-r--r-- | tools/binman/image.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/binman/image.py b/tools/binman/image.py index 74bc46fd30..835b66c99f 100644 --- a/tools/binman/image.py +++ b/tools/binman/image.py @@ -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) |