mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-01 00:50:43 +09:00
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 <sjg@chromium.org>
This commit is contained in:
parent
589d8f917e
commit
d5079330f5
@ -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))
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user