# SPDX-License-Identifier: LGPL-2.1-or-later
efi_config_h_dir = meson.current_build_dir()
+efi_addon = ''
if efi_arch != ''
libefitest = static_library(
if name.startswith('linux')
boot_stubs += exe
endif
+
+ # This is supposed to match exactly one time
+ if name == 'addon@0@.efi.stub'.format(efi_arch)
+ efi_addon = exe.full_path()
+ endif
endforeach
alias_target('systemd-boot', boot_targets)
test_env.set('PATH', project_build_root + ':' + path)
test_env.set('PROJECT_BUILD_ROOT', project_build_root)
+if efi_addon != ''
+ test_env.set('EFI_ADDON', efi_addon)
+endif
+
############################################################
generate_sym_test_py = find_program('generate-sym-test.py')
def test_addon(kernel_initrd, tmpdir):
output = f'{tmpdir}/addon.efi'
- opts = ukify.parse_args([
+ args = [
f'--output={output}',
'--cmdline=ARG1 ARG2 ARG3',
'--section=.test:CONTENTZ',
- ])
+ ]
+ if stub := os.getenv('EFI_ADDON'):
+ args += [f'--stub={stub}']
+ expected_exceptions = ()
+ else:
+ expected_exceptions = FileNotFoundError,
+ opts = ukify.parse_args(args)
try:
ukify.check_inputs(opts)
- except OSError as e:
+ except expected_exceptions as e:
pytest.skip(str(e))
ukify.make_uki(opts)