meson: Use same name format for efi binary intermediates

This commit is contained in:
Jan Janssen 2022-01-26 10:20:46 +01:00
parent b2ba8511e6
commit b6167d9611
2 changed files with 12 additions and 16 deletions

View file

@ -397,16 +397,12 @@ foreach file : fundamental_source_paths + common_sources + systemd_boot_sources
endif
endforeach
systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(efi_arch[0])
stub_elf_name = 'linux@0@.elf.stub'.format(efi_arch[0])
stub_efi_name = 'linux@0@.efi.stub'.format(efi_arch[0])
foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects, false],
[stub_elf_name, stub_efi_name, stub_objects, true]]
so = custom_target(
tuple[0],
input : tuple[2],
output : tuple[0],
foreach tuple : [['systemd-boot@0@.@1@', systemd_boot_objects, false],
['linux@0@.@1@.stub', stub_objects, true]]
elf = custom_target(
tuple[0].format(efi_arch[0], 'elf'),
input : tuple[1],
output : tuple[0].format(efi_arch[0], 'elf'),
command : [cc.cmd_array(),
'-o', '@OUTPUT@',
efi_cflags,
@ -415,13 +411,13 @@ foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects
'-lefi',
'-lgnuefi',
'-lgcc'],
install : tuple[3],
install : tuple[2],
install_dir : bootlibdir)
custom_target(
tuple[1],
input : so,
output : tuple[1],
tuple[0].format(efi_arch[0], 'efi'),
input : elf,
output : tuple[0].format(efi_arch[0], 'efi'),
command : [objcopy,
'-j', '.bss*',
'-j', '.data',

View file

@ -32,10 +32,10 @@ fi
binary=$(realpath "${1}")
if [[ "${1}" =~ systemd-boot([[:alnum:]]+).efi ]]; then
target="systemd-boot"
symbols=$(realpath "$(dirname "${1}")/systemd_boot.so")
symbols=$(realpath "${1%efi}elf")
elif [[ "${1}" =~ linux([[:alnum:]]+).efi.stub ]]; then
target="systemd-stub"
symbols=$(realpath "$(dirname "${1}")/linux${BASH_REMATCH[1]}.elf.stub")
symbols=$(realpath "${1%efi.stub}elf.stub")
else
echo "Cannot detect EFI binary '${1}'."
exit 1