aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/etype/cbfs.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-20 12:24:04 -0600
committerSimon Glass <sjg@chromium.org>2019-07-29 09:38:06 -0600
commita9cd39ef751efdd05a3a5ccae13e28d8a993292d (patch)
treef40b538b4be83f3c0a8a8ad6b829c7a55ee40f7e /tools/binman/etype/cbfs.py
parent17a7421ff417f21d0e3e151c992d7188ded3c0d3 (diff)
binman: Update Entry.ReadEntry() to work through classes
At present we simply extract the data directly from entries using the image_pos information. This happens to work on current entry types, but cannot work if the entry type encodes the data in some way. Update the ReadData() method to provide the data by calling a new ReadChildData() method in the parent. This allows the entry_Section class, or possibly any other container class, to return the correct data in all cases. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/etype/cbfs.py')
-rw-r--r--tools/binman/etype/cbfs.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/binman/etype/cbfs.py b/tools/binman/etype/cbfs.py
index d73c706c44..2bcdf2fd43 100644
--- a/tools/binman/etype/cbfs.py
+++ b/tools/binman/etype/cbfs.py
@@ -262,3 +262,15 @@ class Entry_cbfs(Entry):
def GetEntries(self):
return self._cbfs_entries
+
+ def ReadData(self, decomp=True):
+ data = Entry.ReadData(self, True)
+ return data
+
+ def ReadChildData(self, child, decomp=True):
+ if not self.reader:
+ data = Entry.ReadData(self, True)
+ self.reader = cbfs_util.CbfsReader(data)
+ reader = self.reader
+ cfile = reader.files.get(child.name)
+ return cfile.data if decomp else cfile.orig_data