summaryrefslogtreecommitdiff
path: root/tools/binman/bsection.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-08 13:18:39 -0600
committerSimon Glass <sjg@chromium.org>2019-07-23 20:27:57 -0700
commitcf54904a99ae06e5b38fb670b09dfa60fe1855d5 (patch)
treee5de5abfa75e4de6188300c1e029e3d162b97c4e /tools/binman/bsection.py
parentfa1c93783274dd27da9a88d9d1bf3933f5631b12 (diff)
binman: Update entry.SetOffsetSize to be optional
At present this function always sets both the offset and the size of entries. But in some cases we want to set only one or the other, for example with the forthcoming ifwi entry, where we only set the offset. Update the function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/bsection.py')
-rw-r--r--tools/binman/bsection.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/binman/bsection.py b/tools/binman/bsection.py
index 49b8ef3e3e0..3e3d369d5e4 100644
--- a/tools/binman/bsection.py
+++ b/tools/binman/bsection.py
@@ -236,14 +236,15 @@ class Section(object):
Args:
name: Entry name to update
- offset: New offset
- size: New size
+ offset: New offset, or None to leave alone
+ size: New size, or None to leave alone
"""
entry = self._entries.get(name)
if not entry:
self._Raise("Unable to set offset/size for unknown entry '%s'" %
name)
- entry.SetOffsetSize(self._skip_at_start + offset, size)
+ entry.SetOffsetSize(self._skip_at_start + offset if offset else None,
+ size)
def GetEntryOffsets(self):
"""Handle entries that want to set the offset/size of other entries