summaryrefslogtreecommitdiff
path: root/tools/binman
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-11-23 21:03:50 +0300
committerSimon Glass <sjg@chromium.org>2021-12-02 19:16:30 +0300
commit8cb069ab7467cd4b0a1a4f3fa18ed358c9179557 (patch)
treed66b552fa7fdfda4f279f45494217841e32143ae /tools/binman
parent3f495f18a756c786d39c487061df37ea4b5e1ecd (diff)
downloadu-boot-8cb069ab7467cd4b0a1a4f3fa18ed358c9179557.tar.xz
binman: Move cbfs.ObtainContents() down a bit
It is easier to understand this file if reading the entries comes before obtaining the contents, since that is the order in which Binman proceeds. Move the function down a bit. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman')
-rw-r--r--tools/binman/etype/cbfs.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/binman/etype/cbfs.py b/tools/binman/etype/cbfs.py
index 0a858b8b84..9e04897d71 100644
--- a/tools/binman/etype/cbfs.py
+++ b/tools/binman/etype/cbfs.py
@@ -174,6 +174,21 @@ class Entry_cbfs(Entry):
self.ReadEntries()
self.reader = None
+ def ReadEntries(self):
+ """Read the subnodes to find out what should go in this CBFS"""
+ for node in self._node.subnodes:
+ entry = Entry.Create(self, node)
+ entry.ReadNode()
+ entry._cbfs_name = fdt_util.GetString(node, 'cbfs-name', entry.name)
+ entry._type = fdt_util.GetString(node, 'cbfs-type')
+ compress = fdt_util.GetString(node, 'cbfs-compress', 'none')
+ entry._cbfs_offset = fdt_util.GetInt(node, 'cbfs-offset')
+ entry._cbfs_compress = cbfs_util.find_compress(compress)
+ if entry._cbfs_compress is None:
+ self.Raise("Invalid compression in '%s': '%s'" %
+ (node.name, compress))
+ self._cbfs_entries[entry._cbfs_name] = entry
+
def ObtainContents(self, skip=None):
arch = cbfs_util.find_arch(self._cbfs_arg)
if arch is None:
@@ -204,21 +219,6 @@ class Entry_cbfs(Entry):
self.SetContents(data)
return True
- def ReadEntries(self):
- """Read the subnodes to find out what should go in this CBFS"""
- for node in self._node.subnodes:
- entry = Entry.Create(self, node)
- entry.ReadNode()
- entry._cbfs_name = fdt_util.GetString(node, 'cbfs-name', entry.name)
- entry._type = fdt_util.GetString(node, 'cbfs-type')
- compress = fdt_util.GetString(node, 'cbfs-compress', 'none')
- entry._cbfs_offset = fdt_util.GetInt(node, 'cbfs-offset')
- entry._cbfs_compress = cbfs_util.find_compress(compress)
- if entry._cbfs_compress is None:
- self.Raise("Invalid compression in '%s': '%s'" %
- (node.name, compress))
- self._cbfs_entries[entry._cbfs_name] = entry
-
def SetImagePos(self, image_pos):
"""Override this function to set all the entry properties from CBFS