aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/control.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-11-09 19:14:42 -0700
committerSimon Glass <sjg@chromium.org>2022-11-22 15:13:34 -0700
commitb38da15a054c4ce5ac7c46147995f1387ab24d3b (patch)
tree3a93d7a4d18329d34be85fb1459c09e2e3d52aeb /tools/binman/control.py
parent921b0a6ce2aef19299c702dd4653889189ed81b6 (diff)
binman: Use an exit code when blobs are missing
At present binman returns success when told to handle missing/faked blobs or missing bintools. This is confusing since in fact the resulting image cannot work. Use exit code 103 to signal this problem, with a -W option to convert it to a warning. Rename the flag to --ignore-missing since it controls bintools also. Add documentation about exit codes while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/control.py')
-rw-r--r--tools/binman/control.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py
index bfe63a1520..964c6984f9 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -741,8 +741,15 @@ def Binman(args):
data = state.GetFdtForEtype('u-boot-dtb').GetContents()
elf.UpdateFile(*elf_params, data)
+ # This can only be True if -M is provided, since otherwise binman
+ # would have raised an error already
if invalid:
- tout.warning("\nSome images are invalid")
+ msg = '\nSome images are invalid'
+ if args.ignore_missing:
+ tout.warning(msg)
+ else:
+ tout.error(msg)
+ return 103
# Use this to debug the time take to pack the image
#state.TimingShow()