description : 'boot loader color for selected entries')
option('efi-color-edit', type : 'string', value : 'black,lightgray',
description : 'boot loader color for option line edit')
+option('efi-stub-extra-sections', type : 'integer', value : 30,
+ description : 'minimum number of sections to keep free in stub PE header')
+option('efi-addon-extra-sections', type : 'integer', value : 15,
+ description : 'minimum number of sections to keep free in addon PE header')
option('bashcompletiondir', type : 'string',
description : 'directory for bash completion scripts ["no" disables]')
foreach efi_elf_binary : efi_elf_binaries
name = efi_elf_binary.name()
name += name.startswith('systemd-boot') ? '.efi' : '.efi.stub'
+
# For the addon, given it's empty, we need to explicitly reserve space in the header to account for
# the sections that ukify will add.
- minimum_sections = name.endswith('.stub') ? '15' : '0'
+ if name.startswith('linux')
+ minimum_sections = get_option('efi-stub-extra-sections')
+ elif name.startswith('addon')
+ minimum_sections = get_option('efi-addon-extra-sections')
+ else
+ minimum_sections = 0
+ endif
+
exe = custom_target(
name,
output : name,
'--efi-major=1',
'--efi-minor=1',
'--subsystem=10',
- '--minimum-sections=' + minimum_sections,
+ '--minimum-sections=@0@'.format(minimum_sections),
'--copy-sections=.sbat,.sdmagic,.osrel',
'@INPUT@',
'@OUTPUT@',