Skip to content

Commit 2ac64cf

Browse files
marc-hbkv2019i
authored andcommitted
xtensa-build-zephyr.py: change rimage_options() to return tuples
Zero functional change. This will allow excluding some options. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent fdc05c7 commit 2ac64cf

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

scripts/xtensa-build-zephyr.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -528,13 +528,19 @@ def rimage_configuration(platform_dict):
528528

529529
sign_cmd += ["--tool-path", rimage_executable, "--"]
530530

531-
sign_cmd += rimage_options(platform_dict)
531+
# Flatten the list of [ ( "-o", "value" ), ...] tuples
532+
for t in rimage_options(platform_dict):
533+
sign_cmd += t
534+
532535
return sign_cmd
533536

534537

535538
def rimage_options(platform_dict):
539+
"""Return a list of default rimage options as a list of tuples,
540+
example: [ (-f, 2.5.0), (-b, 1), (-k, key.pem),... ]
536541
537-
sign_cmd = []
542+
"""
543+
opts = []
538544

539545
signing_key = ""
540546
if args.key:
@@ -544,28 +550,28 @@ def rimage_options(platform_dict):
544550
else:
545551
signing_key = default_rimage_key
546552

547-
sign_cmd += ["-k", str(signing_key)]
553+
opts.append(("-k", str(signing_key)))
548554

549555
sof_fw_vers = get_sof_version()
550556

551-
sign_cmd += ["-f", sof_fw_vers]
557+
opts.append(("-f", sof_fw_vers))
552558

553559
# Default value is 0 in rimage but for Zephyr the "build counter" has always
554560
# been hardcoded to 1 in CMake and there is even a (broken) test that fails
555561
# when it's not hardcoded to 1.
556562
# FIXME: drop this line once the following test is fixed
557563
# tests/avs/fw_00_basic/test_01_load_fw_extended.py::TestLoadFwExtended::()::
558564
# test_00_01_load_fw_and_check_version
559-
sign_cmd += ["-b", "1"]
565+
opts.append(("-b", "1"))
560566

561567
if args.ipc == "IPC4":
562568
rimage_desc = platform_dict["IPC4_RIMAGE_DESC"]
563569
else:
564570
rimage_desc = platform_dict["name"] + ".toml"
565571

566-
sign_cmd += ["-c", str(RIMAGE_SOURCE_DIR / "config" / rimage_desc)]
572+
opts.append(("-c", str(RIMAGE_SOURCE_DIR / "config" / rimage_desc)))
567573

568-
return sign_cmd
574+
return opts
569575

570576

571577
STAGING_DIR = None

0 commit comments

Comments
 (0)