xtensa-build-zephyr.py: remove `default_rimage_key` dead code

We used to provide the `default_rimage_key` in two places:
1) as a default `RIMAGE_KEY` attribute (newer `otc_private_key_3k`)
2) as an explicit `else` clause that was never run because of 1) (older
   `otc_private_key`)

Remove the redundant `else` clause in 2); it became dead code. This
simplifies the code and makes the script ready for the day when the key
argument will be optional for rimage (more about this in
https://github.com/zephyrproject-rtos/zephyr/pull/58356)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2023-05-31 18:21:24 +00:00 committed by Kai Vehmanen
parent c81efcf26a
commit 231c4e36de
1 changed files with 3 additions and 5 deletions

View File

@ -60,7 +60,6 @@ VERSION = version.Version("2.0.0")
# Constant value resolves SOF_TOP directory as: "this script directory/.."
SOF_TOP = pathlib.Path(__file__).parents[1].resolve()
west_top = pathlib.Path(SOF_TOP, "..").resolve()
default_rimage_key = pathlib.Path(SOF_TOP, "keys", "otc_private_key.pem")
sof_fw_version = None
@ -587,17 +586,16 @@ def rimage_options(platform_dict):
if args.verbose > 0:
opts.append(("-v",) * args.verbose)
signing_key = ""
signing_key = None
if args.key:
key_path = pathlib.Path(args.key)
assert key_path.exists(), f"{key_path} not found"
signing_key = key_path.resolve()
elif "RIMAGE_KEY" in platform_dict:
signing_key = platform_dict["RIMAGE_KEY"]
else:
signing_key = default_rimage_key
opts.append(("-k", str(signing_key)))
if signing_key is not None:
opts.append(("-k", str(signing_key)))
sof_fw_vers = get_sof_version()