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>
This commit is contained in:
Simon Glass 2019-07-08 14:25:50 -06:00
parent eea264ead3
commit f667e45b1c
5 changed files with 99 additions and 1 deletions

View file

@ -82,7 +82,9 @@ class Image(section.Entry_section):
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"""