aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-11-06 11:27:14 -0500
committerTom Rini <trini@konsulko.com>2020-11-06 11:27:14 -0500
commit22ad69b7987eb4b10221330661db4427e40174fb (patch)
treeb13bc4ba708907cd76a0ec09c4599b55cb586953 /tools/binman/entry.py
parent896cc5aa4a8fc0c28036b9615a37f0034addad44 (diff)
parentdc4b2a9770b5b932cd6d98c33ebff6dc46de6849 (diff)
Merge tag 'dm-pull5nov20' of git://git.denx.de/u-boot-dm
patman status subcommand to collect tags from Patchwork patman showing email replies from Patchwork sandbox poweroff command minor fixes in binman, tests
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 8946d2bc02..2be0d8e053 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -245,7 +245,7 @@ class Entry(object):
state.SetInt(self._node, 'size', self.size)
base = self.section.GetRootSkipAtStart() if self.section else 0
if self.image_pos is not None:
- state.SetInt(self._node, 'image-pos', self.image_pos)
+ state.SetInt(self._node, 'image-pos', self.image_pos - base)
if self.GetImage().allow_repack:
if self.orig_offset is not None:
state.SetInt(self._node, 'orig-offset', self.orig_offset, True)
@@ -456,6 +456,22 @@ class Entry(object):
self.Detail('GetData: size %s' % ToHexSize(self.data))
return self.data
+ def GetPaddedData(self, data=None):
+ """Get the data for an entry including any padding
+
+ Gets the entry data and uses its section's pad-byte value to add padding
+ before and after as defined by the pad-before and pad-after properties.
+
+ This does not consider alignment.
+
+ Returns:
+ Contents of the entry along with any pad bytes before and
+ after it (bytes)
+ """
+ if data is None:
+ data = self.GetData()
+ return self.section.GetPaddedDataForEntry(self, data)
+
def GetOffsets(self):
"""Get the offsets for siblings