summaryrefslogtreecommitdiff
path: root/tools/binman/image.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-08 23:25:50 +0300
committerSimon Glass <sjg@chromium.org>2019-07-24 22:54:08 +0300
commitf667e45b1c0a7f21d433ee8f3ec18858d87dd2e5 (patch)
treeae849665f80553e7689976d578e90250545f5423 /tools/binman/image.py
parenteea264ead3ca198ed66f62a78dc4940075621ae7 (diff)
downloadu-boot-f667e45b1c0a7f21d433ee8f3ec18858d87dd2e5.tar.xz
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>
Diffstat (limited to 'tools/binman/image.py')
-rw-r--r--tools/binman/image.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/binman/image.py b/tools/binman/image.py
index bbb5e23c3b..fb6e591ca6 100644
--- a/tools/binman/image.py
+++ b/tools/binman/image.py
@@ -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"""