diff options
author | Simon Glass | 2022-01-09 20:14:01 -0700 |
---|---|---|
committer | Simon Glass | 2022-01-25 12:36:11 -0700 |
commit | 532ae7043005fb05a7bfa708fdf3fef5c637dd38 (patch) | |
tree | 6fcc4d0caeaaafda297a4756d1d3fa3d8ccc4d50 /tools/patman | |
parent | a104bb2b485c5991750d7bf16294707e7e377ed8 (diff) |
binman: Convert to using the ifwitool bintool
Update the ifwi entry type to use this bintool, instead of running
ifwitool directly. This simplifies the code and provides more
consistency as well as supporting missing bintools.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman')
-rw-r--r-- | tools/patman/tools.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tools/patman/tools.py b/tools/patman/tools.py index a27db05ff2a..072b024646d 100644 --- a/tools/patman/tools.py +++ b/tools/patman/tools.py @@ -596,37 +596,6 @@ def Decompress(indata, algo, with_header=True): raise ValueError("Unknown algorithm '%s'" % algo) return data -CMD_CREATE, CMD_DELETE, CMD_ADD, CMD_REPLACE, CMD_EXTRACT = range(5) - -IFWITOOL_CMDS = { - CMD_CREATE: 'create', - CMD_DELETE: 'delete', - CMD_ADD: 'add', - CMD_REPLACE: 'replace', - CMD_EXTRACT: 'extract', - } - -def RunIfwiTool(ifwi_file, cmd, fname=None, subpart=None, entry_name=None): - """Run ifwitool with the given arguments: - - Args: - ifwi_file: IFWI file to operation on - cmd: Command to execute (CMD_...) - fname: Filename of file to add/replace/extract/create (None for - CMD_DELETE) - subpart: Name of sub-partition to operation on (None for CMD_CREATE) - entry_name: Name of directory entry to operate on, or None if none - """ - args = ['ifwitool', ifwi_file] - args.append(IFWITOOL_CMDS[cmd]) - if fname: - args += ['-f', fname] - if subpart: - args += ['-n', subpart] - if entry_name: - args += ['-d', '-e', entry_name] - Run(*args) - def ToHex(val): """Convert an integer value (or None) to a string |