fwupd/plugins/uefi/meson.build
Gary Lin 5d9984e5ad uefi: add a new option to specify the os name
fu_uefi_get_esp_path_for_os() generates the path to the OS directory
based on "ID" in /etc/os-release, and it may not work for some distros.

Take openSUSE as an example, the "ID" for openSUSE Leap is
"opensuse-leap" and that for openSUSE Tumbleweed is "opensuse-tumbleweed".
However, both of them use the same OS directory in the ESP, i.e.
"/EFI/opensuse".

This commit adds a new build option, efi_os_dir, to allow the packager to
specify the name of OS directory at build time instead of the runtime
detection.

Signed-off-by: Gary Lin <glin@suse.com>
2019-03-29 04:29:42 -04:00

120 lines
2.4 KiB
Meson

subdir('efi')
cargs = ['-DG_LOG_DOMAIN="FuPluginUefi"']
cargs += '-DEFI_APP_LOCATION_BUILD="' + app.full_path() + '"'
efi_os_dir = get_option('efi_os_dir')
if efi_os_dir != ''
cargs += '-DEFI_OS_DIR="' + efi_os_dir + '"'
endif
install_data(['uefi.quirk'],
install_dir: join_paths(datadir, 'fwupd', 'quirks.d')
)
shared_module('fu_plugin_uefi',
fu_hash,
sources : [
'fu-plugin-uefi.c',
'fu-uefi-bgrt.c',
'fu-ucs2.c',
'fu-uefi-bootmgr.c',
'fu-uefi-common.c',
'fu-uefi-device.c',
'fu-uefi-pcrs.c',
'fu-uefi-update-info.c',
'fu-uefi-vars.c',
],
include_directories : [
include_directories('../..'),
include_directories('../../src'),
include_directories('../../libfwupd'),
],
install : true,
install_dir: plugin_dir,
link_with : [
libfwupdprivate,
],
c_args : cargs,
dependencies : [
plugin_deps,
efivar,
efiboot,
],
)
executable(
'fwupdate',
resources_src,
fu_hash,
sources : [
'fu-uefi-tool.c',
'fu-uefi-bgrt.c',
'fu-ucs2.c',
'fu-uefi-bootmgr.c',
'fu-uefi-common.c',
'fu-uefi-device.c',
'fu-uefi-pcrs.c',
'fu-uefi-update-info.c',
'fu-uefi-vars.c',
],
include_directories : [
include_directories('../..'),
include_directories('../../src'),
include_directories('../../libfwupd'),
],
dependencies : [
libxmlb,
giounix,
gusb,
gudev,
efivar,
efiboot,
],
link_with : [
libfwupdprivate,
],
install : true,
install_dir : join_paths(libexecdir, 'fwupd'),
c_args : cargs,
)
install_data(['uefi.conf'],
install_dir: join_paths(sysconfdir, 'fwupd')
)
if get_option('tests')
testdatadir = join_paths(meson.current_source_dir(), 'tests')
cargs += '-DTESTDATADIR="' + testdatadir + '"'
e = executable(
'uefi-self-test',
fu_hash,
sources : [
'fu-self-test.c',
'fu-uefi-bgrt.c',
'fu-uefi-bootmgr.c',
'fu-uefi-common.c',
'fu-uefi-device.c',
'fu-uefi-pcrs.c',
'fu-uefi-update-info.c',
'fu-uefi-vars.c',
'fu-ucs2.c',
],
include_directories : [
include_directories('../..'),
include_directories('../../src'),
include_directories('../../libfwupd'),
],
dependencies : [
plugin_deps,
efivar,
efiboot,
],
link_with : [
libfwupdprivate,
],
c_args : cargs
)
test('uefi-self-test', e)
endif