diff options
author | Tom Rini <trini@konsulko.com> | 2022-02-10 09:02:06 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-02-10 09:19:44 -0500 |
commit | 2ccd2bc8c3580e00c51094c5cc2b3e2ead8d35c3 (patch) | |
tree | 4e7349b8831fee4b342a971025273d3cd042a2f9 /tools/binman/fip_util.py | |
parent | 6662e5e406fdee26ba981dd4af3308f51f254f0a (diff) | |
parent | f3078d4ea707931c2307a623ecf6e4d215b413d5 (diff) |
Merge tag 'dm-pull-8feb22-take3' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
patman snake-case conversion
binman fit improvements
ACPI fixes and making MCFG available to ARM
[trini: Update scripts/pylint.base]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/binman/fip_util.py')
-rwxr-xr-x | tools/binman/fip_util.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/binman/fip_util.py b/tools/binman/fip_util.py index 868d0b6b16d..95eee32bc00 100755 --- a/tools/binman/fip_util.py +++ b/tools/binman/fip_util.py @@ -248,7 +248,7 @@ class FipEntry: self.flags = flags self.fip_type = None self.data = None - self.valid = uuid != tools.GetBytes(0, UUID_LEN) + self.valid = uuid != tools.get_bytes(0, UUID_LEN) if self.valid: # Look up the friendly name matches = {val for (key, val) in FIP_TYPES.items() @@ -309,7 +309,7 @@ class FipWriter: Usage is something like: fip = FipWriter(size) - fip.add_entry('scp-fwu-cfg', tools.ReadFile('something.bin')) + fip.add_entry('scp-fwu-cfg', tools.read_file('something.bin')) ... data = cbw.get_data() @@ -354,7 +354,7 @@ class FipWriter: offset += ENTRY_SIZE # terminating entry for fent in self._fip_entries: - offset = tools.Align(offset, self._align) + offset = tools.align(offset, self._align) fent.offset = offset offset += fent.size @@ -443,7 +443,7 @@ def parse_macros(srcdir): re_uuid = re.compile('0x[0-9a-fA-F]{2}') re_comment = re.compile(r'^/\* (.*) \*/$') fname = os.path.join(srcdir, 'include/tools_share/firmware_image_package.h') - data = tools.ReadFile(fname, binary=False) + data = tools.read_file(fname, binary=False) macros = collections.OrderedDict() comment = None for linenum, line in enumerate(data.splitlines()): @@ -489,7 +489,7 @@ def parse_names(srcdir): re_data = re.compile(r'\.name = "([^"]*)",\s*\.uuid = (UUID_\w*),\s*\.cmdline_name = "([^"]+)"', re.S) fname = os.path.join(srcdir, 'tools/fiptool/tbbr_config.c') - data = tools.ReadFile(fname, binary=False) + data = tools.read_file(fname, binary=False) # Example entry: # { @@ -574,21 +574,21 @@ def parse_atf_source(srcdir, dstfile, oldfile): raise ValueError( f"Expected file '{readme_fname}' - try using -s to specify the " 'arm-trusted-firmware directory') - readme = tools.ReadFile(readme_fname, binary=False) + readme = tools.read_file(readme_fname, binary=False) first_line = 'Trusted Firmware-A' if readme.splitlines()[0] != first_line: raise ValueError(f"'{readme_fname}' does not start with '{first_line}'") macros = parse_macros(srcdir) names = parse_names(srcdir) output = create_code_output(macros, names) - orig = tools.ReadFile(oldfile, binary=False) + orig = tools.read_file(oldfile, binary=False) re_fip_list = re.compile(r'(.*FIP_TYPE_LIST = \[).*?( ] # end.*)', re.S) mat = re_fip_list.match(orig) new_code = mat.group(1) + '\n' + output + mat.group(2) if mat else output if new_code == orig: print(f"Existing code in '{oldfile}' is up-to-date") else: - tools.WriteFile(dstfile, new_code, binary=False) + tools.write_file(dstfile, new_code, binary=False) print(f'Needs update, try:\n\tmeld {dstfile} {oldfile}') |