summaryrefslogtreecommitdiff
path: root/tools/binman/image.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-20 12:23:45 -0600
committerSimon Glass <sjg@chromium.org>2019-07-29 09:38:05 -0600
commitc6bd6e235ac6d6a35e9ad8f3db49db7ba27f7650 (patch)
tree9b33ebb2abaac9fb99e6efa541f6555427dbd7fb /tools/binman/image.py
parent1411ac8d162eaf97714b17848a2da7be1f01fa98 (diff)
downloadu-boot-c6bd6e235ac6d6a35e9ad8f3db49db7ba27f7650.tar.gz
binman: Adjust Entry to read the node in a separate call
At present the Entry constructor sets up the object and then immediately reads its device-tree node to obtain its properties. This breaks a convention that constructors should not do any processing. A consequence is that we must pass all arguments to the constructor and cannot have the node-reading proceed in a different way unless we pass flags to that constructor. We already have a 'test' flag in a few cases, and now need to control whether the 'orig_offset' and 'orig_size' properties are set or not. Adjust the code to require a separate call to ReadNode() after construction. The Image class remains as it was. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/image.py')
-rw-r--r--tools/binman/image.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/binman/image.py b/tools/binman/image.py
index 232e752258..970d33f711 100644
--- a/tools/binman/image.py
+++ b/tools/binman/image.py
@@ -50,9 +50,13 @@ class Image(section.Entry_section):
self.fdtmap_dtb = None
self.fdtmap_data = None
if not test:
- filename = fdt_util.GetString(self._node, 'filename')
- if filename:
- self._filename = filename
+ self.ReadNode()
+
+ def ReadNode(self):
+ section.Entry_section.ReadNode(self)
+ filename = fdt_util.GetString(self._node, 'filename')
+ if filename:
+ self._filename = filename
@classmethod
def FromFile(cls, fname):