odroid-c4/build/board/hardkernel/odroidc4/firmware \
odroid-c4/build/scp_task" binman ...
+Note that binman fails with exit code 103 when there are missing blobs. If you
+wish binman to continue anyway, you can pass `-W` to binman.
+
+
Code coverage
-------------
$ sudo apt-get install python-coverage python3-coverage python-pytest
+Exit status
+-----------
+
+Binman produces the following exit codes:
+
+0
+ Success
+
+1
+ Any sort of failure - see output for more details
+
+103
+ There are missing external blobs or bintools. This is only returned if
+ -M is passed to binman, otherwise missing blobs return an exit status of 1.
+ Note, if -W is passed as well as -M, then this is converted into a warning
+ and will return an exit status of 0 instead.
+
+
Error messages
--------------
build_parser.add_argument('-m', '--map', action='store_true',
default=False, help='Output a map file for each image')
build_parser.add_argument('-M', '--allow-missing', action='store_true',
- default=False, help='Allow external blobs to be missing')
+ default=False, help='Allow external blobs and bintools to be missing')
build_parser.add_argument('-n', '--no-expanded', action='store_true',
help="Don't use 'expanded' versions of entries where available; "
"normally 'u-boot' becomes 'u-boot-expanded', for example")
default=False, help='Update the binman node with offset/size info')
build_parser.add_argument('--update-fdt-in-elf', type=str,
help='Update an ELF file with the output dtb: infile,outfile,begin_sym,end_sym')
+ build_parser.add_argument(
+ '-W', '--ignore-missing', action='store_true', default=False,
+ help='Return success even if there are missing blobs/bintools (requires -M)')
subparsers.add_parser(
'bintool-docs', help='Write out bintool documentation (see bintool.rst)')
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()
use_expanded=False, verbosity=None, allow_missing=False,
allow_fake_blobs=False, extra_indirs=None, threads=None,
test_section_timeout=False, update_fdt_in_elf=None,
- force_missing_bintools=''):
+ force_missing_bintools='', ignore_missing=False):
"""Run binman with a given test file
Args:
args.append('-a%s=%s' % (arg, value))
if allow_missing:
args.append('-M')
+ if ignore_missing:
+ args.append('-W')
if allow_fake_blobs:
args.append('--fake-ext-blobs')
if force_missing_bintools:
def testExtblobMissingOk(self):
"""Test an image with an missing external blob that is allowed"""
with test_util.capture_sys_output() as (stdout, stderr):
- self._DoTestFile('158_blob_ext_missing.dts', allow_missing=True)
+ ret = self._DoTestFile('158_blob_ext_missing.dts',
+ allow_missing=True)
+ self.assertEqual(103, ret)
err = stderr.getvalue()
self.assertRegex(err, "Image 'main-section'.*missing.*: blob-ext")
+ self.assertIn('Some images are invalid', err)
+
+ def testExtblobMissingOkFlag(self):
+ """Test an image with an missing external blob allowed with -W"""
+ with test_util.capture_sys_output() as (stdout, stderr):
+ ret = self._DoTestFile('158_blob_ext_missing.dts',
+ allow_missing=True, ignore_missing=True)
+ self.assertEqual(0, ret)
+ err = stderr.getvalue()
+ self.assertRegex(err, "Image 'main-section'.*missing.*: blob-ext")
+ self.assertIn('Some images are invalid', err)
def testExtblobMissingOkSect(self):
"""Test an image with an missing external blob that is allowed"""