diff options
| author | Simon Glass <[email protected]> | 2023-02-22 12:14:49 -0700 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2023-03-08 11:40:49 -0800 |
| commit | fe7e9245c53e254526d3bbd6296d658596f41b48 (patch) | |
| tree | 3cb3fbeec2d4b0a0e0735a9ccd5e35725df9a006 /tools/binman/control.py | |
| parent | 932e40d0b52242454be9a7773bd2323e12358b92 (diff) | |
binman: Make the tooldir configurable
Add a command-line argument for setting the tooldir, so that the default
can be overridden. Add this directory to the toolpath automatically.
Create the directory if it does not already exist.
Put the default in the argument parser instead of the class, so that it
is more obvious.
Update a few tests that expect the utility name to be provided without
any path (e.g. 'futility'), so they can accept a path, e.g.
/path/to/futility
Update the documentation and add a few tests.
Improve the help for --toolpath while we are here.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'tools/binman/control.py')
| -rw-r--r-- | tools/binman/control.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py index e64740094f6..abe01b76773 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -650,6 +650,14 @@ def Binman(args): from binman.image import Image from binman import state + tool_paths = [] + if args.toolpath: + tool_paths += args.toolpath + if args.tooldir: + tool_paths.append(args.tooldir) + tools.set_tool_paths(tool_paths or None) + bintool.Bintool.set_tool_dir(args.tooldir) + if args.cmd in ['ls', 'extract', 'replace', 'tool']: try: tout.init(args.verbosity) @@ -667,7 +675,6 @@ def Binman(args): allow_resize=not args.fix_size, write_map=args.map) if args.cmd == 'tool': - tools.set_tool_paths(args.toolpath) if args.list: bintool.Bintool.list_all() elif args.fetch: @@ -719,7 +726,6 @@ def Binman(args): try: tools.set_input_dirs(args.indir) tools.prepare_output_dir(args.outdir, args.preserve) - tools.set_tool_paths(args.toolpath) state.SetEntryArgs(args.entry_arg) state.SetThreads(args.threads) |
