binman: Update intel_ifwi to store padded section

With a recent change this entry stores only part of the section data,
leaving out the padding at the end. Fix this by using GetPaddedData() to
get the data. Add this function to the base Entry class also.

Fixes: d1d3ad7d1f ("binman: Move section padding to the parent")

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-11-02 12:55:43 -07:00
parent de429d7b09
commit 271a083806
2 changed files with 17 additions and 1 deletions

View File

@@ -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