From a9cd39ef751efdd05a3a5ccae13e28d8a993292d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 20 Jul 2019 12:24:04 -0600 Subject: 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 --- tools/binman/entry.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tools/binman/entry.py') 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) -- cgit v1.2.3