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>
diff --git a/tools/binman/control.py b/tools/binman/control.py
index bfe63a1..964c698 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -741,8 +741,15 @@
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()