diff options
author | Simon Glass <sjg@chromium.org> | 2018-09-14 04:57:33 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-09-29 11:49:35 -0600 |
commit | 08723a7abbc7e28b22d18684faf5142fc6f155e8 (patch) | |
tree | 92d53765f4f7704cae0e030122deee1f2cf92ea0 /tools/binman/bsection.py | |
parent | f025363543636191cfc6d277733317cb0198189f (diff) |
binman: Record the parent section of each section
At present sections have no record of their parent so it is not possible
to traverse up the tree to the root and figure out the position of a
section within the image.
Change the constructor to record this information.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/bsection.py')
-rw-r--r-- | tools/binman/bsection.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/binman/bsection.py b/tools/binman/bsection.py index 650e9ba353..e4c1900b17 100644 --- a/tools/binman/bsection.py +++ b/tools/binman/bsection.py @@ -24,6 +24,7 @@ class Section(object): Attributes: _node: Node object that contains the section definition in device tree + _parent_section: Parent Section object which created this Section _size: Section size in bytes, or None if not known yet _align_size: Section size alignment, or None _pad_before: Number of bytes before the first entry starts. This @@ -46,14 +47,16 @@ class Section(object): section _entries: OrderedDict() of entries """ - def __init__(self, name, node, test=False): + def __init__(self, name, parent_section, node, image, test=False): global entry global Entry import entry from entry import Entry + self._parent_section = parent_section self._name = name self._node = node + self._image = image self._offset = 0 self._size = None self._align_size = None |