summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2022-10-25 12:06:49 -0700
committerMark Hatle <mark.hatle@amd.com>2022-10-25 12:06:52 -0700
commitbecd730ab1c683d0b960b6e80518a778a390c9fa (patch)
tree60df70d6141402079144e7c2c8fec5aa43227e84
parent202866dfc8275c924ef50fb5196965f89c7bc1c0 (diff)
downloadmeta-xilinx-becd730ab1c683d0b960b6e80518a778a390c9fa.tar.gz
xilinx-bootbin: If a file is missing, avoid a backtrace
Provide a better user experience with a reasonable error message instead of a python backtrace! Signed-off-by: Mark Hatle <mark.hatle@amd.com>
-rw-r--r--meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb b/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
index f914675e..0cab4867 100644
--- a/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
+++ b/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
@@ -44,6 +44,8 @@ def create_bif(config, attrflags, attrimage, ids, common_attr, biffd, d):
44 error_msg = "%s: invalid or missing elf or image" % (cfg) 44 error_msg = "%s: invalid or missing elf or image" % (cfg)
45 bb.error("BIF atrribute Error: %s " % (error_msg)) 45 bb.error("BIF atrribute Error: %s " % (error_msg))
46 imagestr = d.expand(attrimage[cfg]) 46 imagestr = d.expand(attrimage[cfg])
47 if not os.path.exists(imagestr):
48 bb.fatal("Expected file %s, specified from the bif file does not exists!" %(imagestr))
47 if os.stat(imagestr).st_size == 0: 49 if os.stat(imagestr).st_size == 0:
48 bb.warn("Empty file %s, excluding from bif file" %(imagestr)) 50 bb.warn("Empty file %s, excluding from bif file" %(imagestr))
49 continue 51 continue