binman: Allow listing the entries in an image
It is useful to be able to summarise all the entries in an image, e.g. to
display this to this user. Add a new ListEntries() method to Entry, and
set up a way to call it through the Image class.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/image.py b/tools/binman/image.py
index 6339d02..6f4bd5d 100644
--- a/tools/binman/image.py
+++ b/tools/binman/image.py
@@ -162,3 +162,13 @@
file=fd)
self._section.WriteMap(fd, 0)
return fname
+
+ def BuildEntryList(self):
+ """List the files in an image
+
+ Returns:
+ List of entry.EntryInfo objects describing all entries in the image
+ """
+ entries = []
+ self._section.ListEntries(entries, 0)
+ return entries