From: Simon Glass Date: Sat, 20 Jul 2019 18:23:41 +0000 (-0600) Subject: binman: Support loading entry data from a file X-Git-Tag: v2019.10-rc1~1^2~35 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d5079330f588a1aeedc734197124543bbc4e2d3c;p=oweals%2Fu-boot.git binman: Support loading entry data from a file When modifying an image it is convenient to load the data from the file into each entry so that it can be reprocessed. Add a new LoadData() method to handle this. Signed-off-by: Simon Glass --- diff --git a/tools/binman/entry.py b/tools/binman/entry.py index e3c6434822..6436384254 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -695,3 +695,8 @@ features to produce new behaviours. (self.GetPath(), self.offset, self.offset + self.size, self.size, len(data))) return data[self.offset:self.offset + self.size] + + def LoadData(self, decomp=True): + data = self.ReadData(decomp) + self.ProcessContentsUpdate(data) + self.Detail('Loaded data size %x' % len(data)) diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index f29784c1bb..cd623821a3 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -462,3 +462,8 @@ class Entry_section(Entry): self.image_pos, None, self.offset, self) for entry in self._entries.values(): entry.ListEntries(entries, indent + 1) + + def LoadData(self, decomp=True): + for entry in self._entries.values(): + entry.LoadData(decomp) + self.Detail('Loaded data')