Skip to content

Commit 2c5e18b

Browse files
softwareckikartben
authored andcommitted
sign: rimage: Include uuid-registry.h header in toml preprocessing
Add a function generate_uuid_registry that calls the gen-uuid-reg.py script to generate the uuid-registry.h file. If signing an image without sof, trigger the generation of the uuid-registry.h file. Instruct the toml file preprocessor to also use the definitions from the uuid-registry.h file. This will allow the values ​​placed in the uuid-registry to be used in toml files. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent 95179b2 commit 2c5e18b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts/west_commands/sign.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,17 @@ def rimage_config_dir(self):
421421
self.command.dbg(f'rimage config directory={conf_dir}')
422422
return conf_dir
423423

424+
def generate_uuid_registry(self):
425+
'Runs the uuid-registry.h generator script'
426+
427+
generate_cmd = [sys.executable, str(self.sof_src_dir / 'scripts' / 'gen-uuid-reg.py'),
428+
str(self.sof_src_dir / 'uuid-registry.txt'),
429+
str(pathlib.Path('zephyr') / 'include' / 'generated' / 'uuid-registry.h')
430+
]
431+
432+
self.command.inf(quote_sh_list(generate_cmd))
433+
subprocess.run(generate_cmd, check=True, cwd=self.build_dir)
434+
424435
def preprocess_toml(self, config_dir, toml_basename, subdir):
425436
'Runs the C pre-processor on config_dir/toml_basename.h'
426437

@@ -444,6 +455,9 @@ def preprocess_toml(self, config_dir, toml_basename, subdir):
444455
preproc_cmd += ['-I', str(self.sof_src_dir / 'src')]
445456
preproc_cmd += ['-imacros',
446457
str(pathlib.Path('zephyr') / 'include' / 'generated' / 'zephyr' / 'autoconf.h')]
458+
preproc_cmd += ['-imacros',
459+
str(pathlib.Path('zephyr') / 'include' / 'generated' / 'uuid-registry.h')]
460+
447461
# Need to preprocess the TOML file twice: once with
448462
# LLEXT_FORCE_ALL_MODULAR defined and once without it
449463
full_preproc_cmd = preproc_cmd + ['-o', str(subdir / 'rimage_config_full.toml'), '-DLLEXT_FORCE_ALL_MODULAR']
@@ -552,6 +566,7 @@ def sign(self, command, build_dir, build_conf, formats):
552566
is_sof_build = build_conf.getboolean('CONFIG_SOF')
553567
if not is_sof_build:
554568
no_manifest = True
569+
self.generate_uuid_registry()
555570

556571
if no_manifest:
557572
extra_ri_args = [ ]

0 commit comments

Comments
 (0)