mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-09 11:55:27 +00:00
Make TPM more optional (Fixes: #2360)
- Rename the `plugin_tpm` option to `tpm` and when it's disabled remove TPM support from all plugins - If enabled then require the TSS to be installed
This commit is contained in:
parent
d19aff3df1
commit
110eb286bc
@ -22,7 +22,7 @@ meson .. \
|
|||||||
-Dplugin_altos=false \
|
-Dplugin_altos=false \
|
||||||
-Dplugin_dell=false \
|
-Dplugin_dell=false \
|
||||||
-Dplugin_nvme=false \
|
-Dplugin_nvme=false \
|
||||||
-Dplugin_tpm=false \
|
-Dtpm=false \
|
||||||
-Dsystemd=false \
|
-Dsystemd=false \
|
||||||
-Dplugin_emmc=false \
|
-Dplugin_emmc=false \
|
||||||
-Dplugin_amt=false \
|
-Dplugin_amt=false \
|
||||||
|
@ -15,7 +15,7 @@ meson build \
|
|||||||
-Dman=false \
|
-Dman=false \
|
||||||
-Ddaemon=false \
|
-Ddaemon=false \
|
||||||
-Dgusb:tests=false \
|
-Dgusb:tests=false \
|
||||||
-Dplugin_tpm=false \
|
-Dtpm=false \
|
||||||
-Dplugin_modem_manager=false \
|
-Dplugin_modem_manager=false \
|
||||||
-Dplugin_flashrom=false \
|
-Dplugin_flashrom=false \
|
||||||
-Dplugin_uefi=false \
|
-Dplugin_uefi=false \
|
||||||
|
@ -201,11 +201,11 @@ Data files for installed tests.
|
|||||||
%if 0%{?have_uefi}
|
%if 0%{?have_uefi}
|
||||||
-Dplugin_uefi=true \
|
-Dplugin_uefi=true \
|
||||||
-Dplugin_nvme=true \
|
-Dplugin_nvme=true \
|
||||||
-Dplugin_tpm=true \
|
-Dtpm=true \
|
||||||
%else
|
%else
|
||||||
-Dplugin_uefi=false \
|
-Dplugin_uefi=false \
|
||||||
-Dplugin_nvme=false \
|
-Dplugin_nvme=false \
|
||||||
-Dplugin_tpm=false \
|
-Dtpm=false \
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?have_dell}
|
%if 0%{?have_dell}
|
||||||
-Dplugin_dell=true \
|
-Dplugin_dell=true \
|
||||||
|
11
meson.build
11
meson.build
@ -226,10 +226,6 @@ libgcab = dependency('libgcab-1.0', version : '>= 1.0', fallback : ['gcab', 'gca
|
|||||||
gcab = find_program('gcab', required : true)
|
gcab = find_program('gcab', required : true)
|
||||||
bashcomp = dependency('bash-completion', required: false)
|
bashcomp = dependency('bash-completion', required: false)
|
||||||
python3 = find_program('python3')
|
python3 = find_program('python3')
|
||||||
tpm2tss = dependency('tss2-esys', version : '>= 2.0', required: false)
|
|
||||||
if tpm2tss.found()
|
|
||||||
conf.set('HAVE_TSS2', '1')
|
|
||||||
endif
|
|
||||||
|
|
||||||
platform_deps = []
|
platform_deps = []
|
||||||
if get_option('default_library') != 'static'
|
if get_option('default_library') != 'static'
|
||||||
@ -290,8 +286,11 @@ if cc.has_function('pwrite', args : '-D_XOPEN_SOURCE')
|
|||||||
conf.set('HAVE_PWRITE', '1')
|
conf.set('HAVE_PWRITE', '1')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if build_standalone and get_option('plugin_tpm') and not tpm2tss.found()
|
if build_standalone and get_option('tpm')
|
||||||
error('tss2-esys is required for -Dplugin_tpm=true')
|
tpm2tss = dependency('tss2-esys', version : '>= 2.0')
|
||||||
|
conf.set('HAVE_TSS2', '1')
|
||||||
|
else
|
||||||
|
tpm2tss = dependency('', required: false)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if build_standalone and get_option('plugin_uefi')
|
if build_standalone and get_option('plugin_uefi')
|
||||||
|
@ -15,7 +15,6 @@ option('plugin_emmc', type : 'boolean', value : true, description : 'enable eMMC
|
|||||||
option('plugin_synaptics', type: 'boolean', value: true, description : 'enable Synaptics MST hub support')
|
option('plugin_synaptics', type: 'boolean', value: true, description : 'enable Synaptics MST hub support')
|
||||||
option('plugin_thunderbolt', type : 'boolean', value : true, description : 'enable Thunderbolt support')
|
option('plugin_thunderbolt', type : 'boolean', value : true, description : 'enable Thunderbolt support')
|
||||||
option('plugin_redfish', type : 'boolean', value : true, description : 'enable Redfish support')
|
option('plugin_redfish', type : 'boolean', value : true, description : 'enable Redfish support')
|
||||||
option('plugin_tpm', type : 'boolean', value : true, description : 'enable TPM support')
|
|
||||||
option('plugin_uefi', type : 'boolean', value : true, description : 'enable UEFI support')
|
option('plugin_uefi', type : 'boolean', value : true, description : 'enable UEFI support')
|
||||||
option('plugin_nvme', type : 'boolean', value : true, description : 'enable NVMe support')
|
option('plugin_nvme', type : 'boolean', value : true, description : 'enable NVMe support')
|
||||||
option('plugin_modem_manager', type : 'boolean', value : false, description : 'enable ModemManager support')
|
option('plugin_modem_manager', type : 'boolean', value : false, description : 'enable ModemManager support')
|
||||||
@ -27,6 +26,7 @@ option('systemd', type : 'boolean', value : true, description : 'enable systemd
|
|||||||
option('systemd_root_prefix', type: 'string', value: '', description: 'Directory to base systemd’s installation directories on')
|
option('systemd_root_prefix', type: 'string', value: '', description: 'Directory to base systemd’s installation directories on')
|
||||||
option('elogind', type : 'boolean', value : false, description : 'enable elogind support')
|
option('elogind', type : 'boolean', value : false, description : 'enable elogind support')
|
||||||
option('tests', type : 'boolean', value : true, description : 'enable tests')
|
option('tests', type : 'boolean', value : true, description : 'enable tests')
|
||||||
|
option('tpm', type : 'boolean', value : true, description : 'enable TPM support')
|
||||||
option('udevdir', type: 'string', value: '', description: 'Directory for udev rules')
|
option('udevdir', type: 'string', value: '', description: 'Directory for udev rules')
|
||||||
option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules')
|
option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules')
|
||||||
option('efi-ld', type : 'string', value : 'ld', description : 'the linker to use for EFI modules')
|
option('efi-ld', type : 'string', value : 'ld', description : 'the linker to use for EFI modules')
|
||||||
|
@ -57,9 +57,9 @@ endif
|
|||||||
# depends on dfu
|
# depends on dfu
|
||||||
subdir('csr')
|
subdir('csr')
|
||||||
|
|
||||||
if get_option('plugin_tpm')
|
if get_option('tpm')
|
||||||
if not get_option('gudev')
|
if not get_option('gudev')
|
||||||
error('gudev is required for plugin_tpm')
|
error('gudev is required for tpm')
|
||||||
endif
|
endif
|
||||||
subdir('tpm')
|
subdir('tpm')
|
||||||
subdir('tpm-eventlog')
|
subdir('tpm-eventlog')
|
||||||
|
@ -50,6 +50,11 @@ fu_uefi_pcrs_2_0_func (void)
|
|||||||
const gchar *tpm_server_running = g_getenv ("TPM_SERVER_RUNNING");
|
const gchar *tpm_server_running = g_getenv ("TPM_SERVER_RUNNING");
|
||||||
g_setenv ("FWUPD_FORCE_TPM2", "1", TRUE);
|
g_setenv ("FWUPD_FORCE_TPM2", "1", TRUE);
|
||||||
|
|
||||||
|
#ifndef HAVE_TSS2
|
||||||
|
g_test_skip ("Compiled without TPM2.0 support");
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GETUID
|
#ifdef HAVE_GETUID
|
||||||
if (tpm_server_running == NULL &&
|
if (tpm_server_running == NULL &&
|
||||||
(getuid () != 0 || geteuid () != 0)) {
|
(getuid () != 0 || geteuid () != 0)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user