]> git.sur5r.net Git - u-boot/blobdiff - tools/binman/image.py
binman: Add support for outputing a map file
[u-boot] / tools / binman / image.py
index 74bc46fd30c106837bcb3a18221cf770363365e9..835b66c99f5f188a74e9934860552e74760fa370 100644 (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)