[PATCH 1/3] binman: fix passing loadables to mkimage on first run

al.kochet at gmail.com al.kochet at gmail.com
Mon Sep 16 10:24:44 CEST 2024


From: Alexander Kochetkov <al.kochet at gmail.com>

FIT use mkimage from BuildSectionData() to build FIT entry contents.
BuildSectionData() get called several times during building FIT image.

Currently when fit inserts loadables, it use self._loadables property that
contain loadables computed during previuos BuildSectionData() invocation.
So for the first run it use empty list and pass no loadables to mkimage.

That makes problem for adding signature to FIT image because mkimage
fails to add signature and aborts building FIT if no loadables provided.

The patch fixes described behaviour in a way that BuildSectionData() uses
recently calculated loadables value, not previosly calculated.

Signed-off-by: Alexander Kochetkov <al.kochet at gmail.com>
---
 tools/binman/etype/fit.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py
index 2c14b15b03..e96222f4b6 100644
--- a/tools/binman/etype/fit.py
+++ b/tools/binman/etype/fit.py
@@ -542,8 +542,8 @@ class Entry_fit(Entry_section):
             """
             val = fdt_util.GetStringList(node, 'fit,firmware')
             if val is None:
-                return None, self._loadables
-            valid_entries = list(self._loadables)
+                return None, loadables
+            valid_entries = list(loadables)
             for name, entry in self.GetEntries().items():
                 missing = []
                 entry.CheckMissing(missing)
@@ -558,7 +558,7 @@ class Entry_fit(Entry_section):
                         firmware = name
                     elif name not in result:
                         result.append(name)
-            for name in self._loadables:
+            for name in loadables:
                 if name != firmware and name not in result:
                     result.append(name)
             return firmware, result
-- 
2.17.1



More information about the U-Boot mailing list