Skip to content
Permalink
Browse files

scripts: west sign: move hex and bin default locations

When signing binaries from multiple build directories, it is
inconvenient to have to specify the output file locations by hand each
time. It's also a little weird that they're not next to zephyr.bin and
zephyr.hex.

Move them to the build directory, next to their unsigned variants.

Suggested by Piotr Mienkowski.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
  • Loading branch information...
mbolivar authored and nashif committed Jun 12, 2019
1 parent 06c9f8e commit 33cbba3457515f6dd19c52cb2f210c914cafa7d9
Showing with 10 additions and 6 deletions.
  1. +10 −6 scripts/west_commands/sign.py
@@ -102,9 +102,9 @@ def do_add_parser(self, parser_adder):
help='''produce a signed .bin file?
(default: yes, if supported)''')
group.add_argument('-B', '--sbin', metavar='BIN',
default='zephyr.signed.bin',
help='''signed .bin file name
(default: zephyr.signed.bin)''')
(default: zephyr.signed.bin in the build
directory, next to zephyr.bin)''')

# hex file options
group = parser.add_argument_group('Intel HEX (.hex) file options')
@@ -113,9 +113,9 @@ def do_add_parser(self, parser_adder):
help='''produce a signed .hex file?
(default: yes, if supported)''')
group.add_argument('-H', '--shex', metavar='HEX',
default='zephyr.signed.hex',
help='''signed .hex file name
(default: zephyr.signed.hex)''')
(default: zephyr.signed.hex in the build
directory, next to zephyr.hex)''')

# defaults for hex/bin generation
parser.set_defaults(gen_bin=True, gen_hex=True)
@@ -171,15 +171,19 @@ def sign(self, command, build_dir):

# Build a signed .bin
if args.gen_bin and runner_config.bin_file:
sbin = args.sbin or os.path.join(build_dir, 'zephyr',
'zephyr.signed.bin')
sign_bin = self.sign_cmd(command, bcfg, runner_config.bin_file,
args.sbin)
sbin)
log.dbg(quote_sh_list(sign_bin))
subprocess.check_call(sign_bin)

# Build a signed .hex
if args.gen_hex and runner_config.hex_file:
shex = args.shex or os.path.join(build_dir, 'zephyr',
'zephyr.signed.hex')
sign_hex = self.sign_cmd(command, bcfg, runner_config.hex_file,
args.shex)
shex)
log.dbg(quote_sh_list(sign_hex))
subprocess.check_call(sign_hex)

0 comments on commit 33cbba3

Please sign in to comment.
You can’t perform that action at this time.