diff options
Diffstat (limited to 'tools/binman')
-rw-r--r-- | tools/binman/elf.py | 2 | ||||
-rw-r--r-- | tools/binman/etype/fit.py | 2 | ||||
-rw-r--r-- | tools/binman/etype/section.py | 17 | ||||
-rw-r--r-- | tools/binman/ftest.py | 7 | ||||
-rwxr-xr-x | tools/binman/main.py | 8 | ||||
-rw-r--r-- | tools/binman/requirements.txt | 1 | ||||
-rw-r--r-- | tools/binman/state.py | 3 | ||||
-rw-r--r-- | tools/binman/test/184_compress_section_size.dts | 1 |
8 files changed, 16 insertions, 25 deletions
diff --git a/tools/binman/elf.py b/tools/binman/elf.py index c75f4478813..6ac960e0419 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -28,7 +28,7 @@ except: # pragma: no cover # BSYM in little endian, keep in sync with include/binman_sym.h BINMAN_SYM_MAGIC_VALUE = 0x4d595342 -# Information about an EFL symbol: +# Information about an ELF symbol: # section (str): Name of the section containing this symbol # address (int): Address of the symbol (its value) # size (int): Size of the symbol in bytes diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py index 803fb66ea83..ed3cac4ee7e 100644 --- a/tools/binman/etype/fit.py +++ b/tools/binman/etype/fit.py @@ -562,8 +562,6 @@ class Entry_fit(Entry_section): for subnode in node.subnodes: if (subnode.name.startswith('signature') or subnode.name.startswith('cipher')): - if subnode.props.get('key-name-hint') is None: - continue hint = subnode.props['key-name-hint'].value name = tools.get_input_filename( f"{hint}.key" if subnode.name.startswith('signature') diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index 5e11cf58d28..4c4c8c417f8 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -662,23 +662,6 @@ class Entry_section(Entry): else: raise ValueError("%s: No such property '%s'" % (msg, prop_name)) - def GetRootSkipAtStart(self): - """Get the skip-at-start value for the top-level section - - This is used to find out the starting offset for root section that - contains this section. If this is a top-level section then it returns - the skip-at-start offset for this section. - - This is used to get the absolute position of section within the image. - - Returns: - Integer skip-at-start value for the root section containing this - section - """ - if self.section: - return self.section.GetRootSkipAtStart() - return self._skip_at_start - def GetStartOffset(self): """Get the start offset for this section diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 948fcc02259..92df2a03650 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -4613,6 +4613,8 @@ class TestFunctional(unittest.TestCase): dtb.Scan() props = self._GetPropTree(dtb, ['offset', 'image-pos', 'size', 'uncomp-size']) + data = data[:0x30] + data = data.rstrip(b'\xff') orig = self._decompress(data) self.assertEqual(COMPRESS_DATA + U_BOOT_DATA, orig) expected = { @@ -6218,8 +6220,9 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testCompUtilPadding(self): """Test padding of compression algorithms""" - # Skip zstd because it doesn't support padding - for bintool in [v for k,v in self.comp_bintools.items() if k != 'zstd']: + # Skip zstd and lz4 because they doesn't support padding + for bintool in [v for k,v in self.comp_bintools.items() + if not k in ['zstd', 'lz4']]: self._CheckBintool(bintool) data = bintool.compress(COMPRESS_DATA) self.assertNotEqual(COMPRESS_DATA, data) diff --git a/tools/binman/main.py b/tools/binman/main.py index 619840e7d55..326f5c93155 100755 --- a/tools/binman/main.py +++ b/tools/binman/main.py @@ -94,10 +94,16 @@ def RunTestCoverage(toolpath, build_dir, args): if toolpath: for path in toolpath: extra_args += ' --toolpath %s' % path + + # Some files unfortunately don't thave the required test coverage. This will + # eventually be fixed, but exclude them for now test_util.run_test_coverage('tools/binman/binman', None, ['*test*', '*main.py', 'tools/patman/*', 'tools/dtoc/*', 'tools/u_boot_pylib/*'], - build_dir, all_set, extra_args or None, args=args) + build_dir, all_set, extra_args or None, args=args, + allow_failures=['tools/binman/btool/cst.py', + 'tools/binman/etype/nxp_imx8mcst.py', + 'tools/binman/etype/nxp_imx8mimage.py']) def RunBinman(args): """Main entry point to binman once arguments are parsed diff --git a/tools/binman/requirements.txt b/tools/binman/requirements.txt index f068ef75a30..7db72e888e3 100644 --- a/tools/binman/requirements.txt +++ b/tools/binman/requirements.txt @@ -1,3 +1,4 @@ +coverage==7.8.0 importlib_resources==6.5.2 jsonschema==4.23.0 pycryptodomex==3.21.0 diff --git a/tools/binman/state.py b/tools/binman/state.py index 6772d3678fe..f4d885c772a 100644 --- a/tools/binman/state.py +++ b/tools/binman/state.py @@ -411,8 +411,7 @@ def CheckSetHashValue(node, get_data_func): m = hashlib.sha256() m.update(get_data_func()) data = m.digest() - if data is None: - raise ValueError(f"Node '{node.path}': Unknown hash algorithm '{algo}'") + assert data for n in GetUpdateNodes(hash_node): n.SetData('value', data) diff --git a/tools/binman/test/184_compress_section_size.dts b/tools/binman/test/184_compress_section_size.dts index 95ed30add1a..1c1dbd5f580 100644 --- a/tools/binman/test/184_compress_section_size.dts +++ b/tools/binman/test/184_compress_section_size.dts @@ -6,6 +6,7 @@ section { size = <0x30>; compress = "lz4"; + pad-byte = <0xff>; blob { filename = "compress"; }; |