summaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-20 21:24:04 +0300
committerSimon Glass <sjg@chromium.org>2019-07-29 18:38:06 +0300
commita9cd39ef751efdd05a3a5ccae13e28d8a993292d (patch)
treef40b538b4be83f3c0a8a8ad6b829c7a55ee40f7e /tools/binman/entry.py
parent17a7421ff417f21d0e3e151c992d7188ded3c0d3 (diff)
downloadu-boot-a9cd39ef751efdd05a3a5ccae13e28d8a993292d.tar.xz
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/entry.py')
-rw-r--r--tools/binman/entry.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 90192c11b7..8416214fc9 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -714,11 +714,8 @@ features to produce new behaviours.
"""
# Use True here so that we get an uncompressed section to work from,
# although compressed sections are currently not supported
- data = self.section.ReadData(True)
- tout.Info('%s: Reading data from offset %#x-%#x, size %#x (avail %#x)' %
- (self.GetPath(), self.offset, self.offset + self.size,
- self.size, len(data)))
- return data[self.offset:self.offset + self.size]
+ data = self.section.ReadChildData(self, decomp)
+ return data
def LoadData(self, decomp=True):
data = self.ReadData(decomp)