diff mbox series

[U-Boot,11/34] binman: Fix IFWI output when using an Intel FIT image

Message ID 20190824132315.53130-12-sjg@chromium.org
State Accepted
Commit e95be637c47463f771998fe7b890daec032dcb8e
Delegated to: Simon Glass
Headers show
Series binman: Various improvements and tidy-ups | expand

Commit Message

Simon Glass Aug. 24, 2019, 1:22 p.m. UTC
At present this entry does not work correctly when a FIT image is used as
the input. It updates the FIT instead of the output image. The test passed
because the FIT image happened to have the right data already.

Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/etype/intel_ifwi.py | 6 +++---
 tools/binman/ftest.py            | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Simon Glass Sept. 27, 2019, 12:39 a.m. UTC | #1
At present this entry does not work correctly when a FIT image is used as
the input. It updates the FIT instead of the output image. The test passed
because the FIT image happened to have the right data already.

Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/etype/intel_ifwi.py | 6 +++---
 tools/binman/ftest.py            | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py
index f3745f7a8c..e4da3e498a 100644
--- a/tools/binman/etype/intel_ifwi.py
+++ b/tools/binman/etype/intel_ifwi.py
@@ -75,10 +75,10 @@  class Entry_intel_ifwi(Entry_blob):
             self._pathname = outname
         else:
             # Provide a different code path here to ensure we have test coverage
-            inname = self._pathname
+            outname = self._pathname
 
         # Delete OBBP if it is there, then add the required new items.
-        tools.RunIfwiTool(inname, tools.CMD_DELETE, subpart='OBBP')
+        tools.RunIfwiTool(outname, tools.CMD_DELETE, subpart='OBBP')
 
         for entry in self._ifwi_entries.values():
             # First get the input data and put it in a file
@@ -89,7 +89,7 @@  class Entry_intel_ifwi(Entry_blob):
             input_fname = tools.GetOutputFilename('input.%s' % uniq)
             tools.WriteFile(input_fname, data)
 
-            tools.RunIfwiTool(inname,
+            tools.RunIfwiTool(outname,
                 tools.CMD_REPLACE if entry._ifwi_replace else tools.CMD_ADD,
                 input_fname, entry._ifwi_subpart, entry._ifwi_entry_name)
 
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 080599fee3..bba07e7275 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -2044,7 +2044,7 @@  class TestFunctional(unittest.TestCase):
                           subpart='IBBP', entry_name='IBBL')
 
         tpl_data = tools.ReadFile(tpl_fname)
-        self.assertEqual(tpl_data[:len(U_BOOT_TPL_DATA)], U_BOOT_TPL_DATA)
+        self.assertEqual(U_BOOT_TPL_DATA, tpl_data[:len(U_BOOT_TPL_DATA)])
 
     def testPackX86RomIfwi(self):
         """Test that an x86 ROM with Integrated Firmware Image can be created"""