Skip to content

Commit 478a2a5

Browse files
committed
west: sign/rimage: use env var SOF_SRC_DIR for SOF source dir
After removal of SOF from manifest, if rimage is in path, the build would fail because the gen-uuid-reg.py cannot be found anymore. So add a way to specify where the SOF source is, so the signing script can find gen-uuid-reg.py. This would allow building and signing without the SOF manifest. Signed-off-by: Daniel Leung <[email protected]>
1 parent 1380739 commit 478a2a5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

scripts/west_commands/sign.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,14 @@ def sign(self, command, build_dir, build_conf, formats):
554554
if not args.quiet:
555555
command.inf('Signing with tool {}'.format(tool_path))
556556

557-
try:
558-
sof_proj = command.manifest.get_projects(['sof'], allow_paths=False)
559-
sof_src_dir = pathlib.Path(sof_proj[0].abspath)
560-
except ValueError: # sof is the manifest
561-
sof_src_dir = pathlib.Path(manifest.manifest_path()).parent
557+
if os.getenv("SOF_SRC_DIR"):
558+
sof_src_dir = pathlib.Path(os.getenv("SOF_SRC_DIR"))
559+
else:
560+
try:
561+
sof_proj = command.manifest.get_projects(['sof'], allow_paths=False)
562+
sof_src_dir = pathlib.Path(sof_proj[0].abspath)
563+
except ValueError: # sof is the manifest
564+
sof_src_dir = pathlib.Path(manifest.manifest_path()).parent
562565

563566
self.sof_src_dir = sof_src_dir
564567

0 commit comments

Comments
 (0)