We have the BINMAN_INDIRS for any external binaries, so they don't have
to be copied into the source/build directory of u-boot. This is
especially important for image builders like buildroot.

If it is an external binary and if it was not found, use the
get_input_filename() helper which will also look up the paths in
BINMAN_INDIRS.

Signed-off-by: Michael Walle <[email protected]>
---
This is somewhat redundant and get_input_filename() could probably be
used directly. But this is the least invasive change.

v2:
 - forgot to add second lookup. add the same fix

---
 tools/binman/etype/nxp_imx9image.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/binman/etype/nxp_imx9image.py 
b/tools/binman/etype/nxp_imx9image.py
index e0e806f2b7f..29b712bb01a 100644
--- a/tools/binman/etype/nxp_imx9image.py
+++ b/tools/binman/etype/nxp_imx9image.py
@@ -55,13 +55,15 @@ class Entry_nxp_imx9image(Entry_mkimage):
                     combined = ' '.join(map(str, value))
 
                     if file in external_files and not os.path.exists(value[1]):
-                        print(f"file '{image_path}' does not exist. flash.bin 
may be not-functional.")
+                        value[1] = tools.get_input_filename(file, 
allow_missing=True)
+                        if not value[1]:
+                            print(f"file '{image_path}' does not exist. 
flash.bin may be not-functional.")
                     else:
                         f.write(f'image {combined}\n')
                 elif isinstance(value, str):
                     if key.startswith('append'):
-                        file_path = os.path.join(tools.get_output_dir(), value)
-                        if os.path.exists(file_path):
+                        file_path = tools.get_input_filename(value, 
allow_missing=True)
+                        if file_path:
                             f.write(f'append {file_path}\n')
                         else:
                             print(f"file '{file_path}' does not exist. 
flash.bin may be not-functional.")
-- 
2.47.3

Reply via email to