binman: Support loading entry data from a file
When modifying an image it is convenient to load the data from the file
into each entry so that it can be reprocessed. Add a new LoadData() method
to handle this.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index e3c6434..6436384 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -695,3 +695,8 @@
(self.GetPath(), self.offset, self.offset + self.size,
self.size, len(data)))
return data[self.offset:self.offset + self.size]
+
+ def LoadData(self, decomp=True):
+ data = self.ReadData(decomp)
+ self.ProcessContentsUpdate(data)
+ self.Detail('Loaded data size %x' % len(data))