binman: Update intel_ifwi to store padded section
PATCH 1/2 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.
---
tools/binman/entry.py | 16 ++++++++++++++++ tools/binman/etype/intel_ifwi.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-)
tools/binman/entry.py +16 -0
@@ -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
tools/binman/etype/intel_ifwi.py +1 -1
@@ -71,7 +71,7 @@ class Entry_intel_ifwi(Entry_blob_ext): for entry in self._ifwi_entries.values(): # First get the input data and put it in a file - data = entry.GetData() + data = entry.GetPaddedData() uniq = self.GetUniqueName() input_fname = tools.GetOutputFilename('input.%s' % uniq) tools.WriteFile(input_fname, data)
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
PATCH 1/2 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.
---
tools/binman/entry.py | 16 ++++++++++++++++ tools/binman/etype/intel_ifwi.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH 2/2 binman: Correct calculation for image-pos
In reply to Simon GlassA recent change removed the base offset from the calculation. This is used on coral to find the FSP-S binary. Fix it.
---
tools/binman/entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/binman/entry.py +1 -1
@@ -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)
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
PATCH 2/2 binman: Correct calculation for image-pos
A recent change removed the base offset from the calculation. This is used on coral to find the FSP-S binary. Fix it.
---
tools/binman/entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-dm, thanks!