summaryrefslogtreecommitdiffstats
path: root/tools/binman/image.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-08 14:25:37 -0600
committerSimon Glass <sjg@chromium.org>2019-07-24 12:54:08 -0700
commitc52c9e7da809e36001d125891e594c4740235055 (patch)
treeb2a206a5487a5cd7b156659e2358ccf0ccc92f98 /tools/binman/image.py
parentbf6906bab4129660a74639e3fafb463917778d2b (diff)
downloadu-boot-c52c9e7da809e36001d125891e594c4740235055.tar.gz
u-boot-c52c9e7da809e36001d125891e594c4740235055.tar.xz
u-boot-c52c9e7da809e36001d125891e594c4740235055.zip
binman: Allow entries to expand after packing
Add support for detecting entries that change size after they have already been packed, and re-running packing when it happens. This removes the limitation that entry size cannot change after PackEntries() is called. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/image.py')
-rw-r--r--tools/binman/image.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/binman/image.py b/tools/binman/image.py
index c8bce394aa..6339d020e7 100644
--- a/tools/binman/image.py
+++ b/tools/binman/image.py
@@ -55,6 +55,10 @@ class Image:
self._filename = filename
self._section = bsection.Section('main-section', None, self._node, self)
+ def Raise(self, msg):
+ """Convenience function to raise an error referencing an image"""
+ raise ValueError("Image '%s': %s" % (self._node.path, msg))
+
def GetFdtSet(self):
"""Get the set of device tree files used by this image"""
return self._section.GetFdtSet()
@@ -100,6 +104,10 @@ class Image:
"""
self._section.GetEntryOffsets()
+ def ResetForPack(self):
+ """Reset offset/size fields so that packing can be done again"""
+ self._section.ResetForPack()
+
def PackEntries(self):
"""Pack all entries into the image"""
self._section.PackEntries()