binman: Allow reading an entry from an image
It is useful to be able to extract entry contents from an image to see
what is inside. Add a simple function to read the contents of an entry,
decompressing it by default.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/image.py b/tools/binman/image.py
index bbb5e23..fb6e591 100644
--- a/tools/binman/image.py
+++ b/tools/binman/image.py
@@ -82,7 +82,9 @@
dtb.Scan()
# Return an Image with the associated nodes
- return Image('image', dtb.GetRoot())
+ image = Image('image', dtb.GetRoot())
+ image._data = data
+ return image
def Raise(self, msg):
"""Convenience function to raise an error referencing an image"""