Skip to content

Commit

Permalink
west: sign: add west config [rimage].path = /path/to/rimage
Browse files Browse the repository at this point in the history
Add a 3rd option besides --tool-path and $PATH

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb authored and nashif committed Apr 11, 2023
1 parent dedb002 commit 66ac625
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions scripts/west_commands/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,15 @@ class RimageSigner(Signer):
def sign(self, command, build_dir, build_conf, formats):
args = command.args

if args.tool_path:
command.check_force(shutil.which(args.tool_path),
'--tool-path {}: not an executable'.
format(args.tool_path))
tool_path = args.tool_path
tool_path = (
args.tool_path if args.tool_path else
config_get(command.config, 'rimage.path', None)
)
err_prefix = '--tool-path' if args.tool_path else 'west config'

if tool_path:
command.check_force(shutil.which(tool_path),
f'{err_prefix} {tool_path}: not an executable')
else:
tool_path = shutil.which('rimage')
if not tool_path:
Expand Down

0 comments on commit 66ac625

Please sign in to comment.