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>
This commit is contained in:
parent
95179b24c7
commit
2c5e18b971
1 changed files with 15 additions and 0 deletions
|
@ -421,6 +421,17 @@ class RimageSigner(Signer):
|
||||||
self.command.dbg(f'rimage config directory={conf_dir}')
|
self.command.dbg(f'rimage config directory={conf_dir}')
|
||||||
return conf_dir
|
return conf_dir
|
||||||
|
|
||||||
|
def generate_uuid_registry(self):
|
||||||
|
'Runs the uuid-registry.h generator script'
|
||||||
|
|
||||||
|
generate_cmd = [sys.executable, str(self.sof_src_dir / 'scripts' / 'gen-uuid-reg.py'),
|
||||||
|
str(self.sof_src_dir / 'uuid-registry.txt'),
|
||||||
|
str(pathlib.Path('zephyr') / 'include' / 'generated' / 'uuid-registry.h')
|
||||||
|
]
|
||||||
|
|
||||||
|
self.command.inf(quote_sh_list(generate_cmd))
|
||||||
|
subprocess.run(generate_cmd, check=True, cwd=self.build_dir)
|
||||||
|
|
||||||
def preprocess_toml(self, config_dir, toml_basename, subdir):
|
def preprocess_toml(self, config_dir, toml_basename, subdir):
|
||||||
'Runs the C pre-processor on config_dir/toml_basename.h'
|
'Runs the C pre-processor on config_dir/toml_basename.h'
|
||||||
|
|
||||||
|
@ -444,6 +455,9 @@ class RimageSigner(Signer):
|
||||||
preproc_cmd += ['-I', str(self.sof_src_dir / 'src')]
|
preproc_cmd += ['-I', str(self.sof_src_dir / 'src')]
|
||||||
preproc_cmd += ['-imacros',
|
preproc_cmd += ['-imacros',
|
||||||
str(pathlib.Path('zephyr') / 'include' / 'generated' / 'zephyr' / 'autoconf.h')]
|
str(pathlib.Path('zephyr') / 'include' / 'generated' / 'zephyr' / 'autoconf.h')]
|
||||||
|
preproc_cmd += ['-imacros',
|
||||||
|
str(pathlib.Path('zephyr') / 'include' / 'generated' / 'uuid-registry.h')]
|
||||||
|
|
||||||
# Need to preprocess the TOML file twice: once with
|
# Need to preprocess the TOML file twice: once with
|
||||||
# LLEXT_FORCE_ALL_MODULAR defined and once without it
|
# LLEXT_FORCE_ALL_MODULAR defined and once without it
|
||||||
full_preproc_cmd = preproc_cmd + ['-o', str(subdir / 'rimage_config_full.toml'), '-DLLEXT_FORCE_ALL_MODULAR']
|
full_preproc_cmd = preproc_cmd + ['-o', str(subdir / 'rimage_config_full.toml'), '-DLLEXT_FORCE_ALL_MODULAR']
|
||||||
|
@ -552,6 +566,7 @@ class RimageSigner(Signer):
|
||||||
is_sof_build = build_conf.getboolean('CONFIG_SOF')
|
is_sof_build = build_conf.getboolean('CONFIG_SOF')
|
||||||
if not is_sof_build:
|
if not is_sof_build:
|
||||||
no_manifest = True
|
no_manifest = True
|
||||||
|
self.generate_uuid_registry()
|
||||||
|
|
||||||
if no_manifest:
|
if no_manifest:
|
||||||
extra_ri_args = [ ]
|
extra_ri_args = [ ]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue