From a03746abc13a835019d246c38cca2924a911edf5 Mon Sep 17 00:00:00 2001 From: Lars Wendler Date: Wed, 7 May 2025 13:48:45 +0200 Subject: [PATCH 2/4] Revert "trivial: Remove -Dplugin_uefi_capsule build option" This reverts commit ce5b7d7f9539f8344449908808b724427ba73778. --- contrib/ci/debian_s390x.sh | 1 + contrib/fwupd.spec.in | 5 +++++ data/meson.build | 2 +- meson.build | 3 +-- meson_options.txt | 4 ++++ plugins/uefi-capsule/README.md | 3 +++ 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/contrib/ci/debian_s390x.sh b/contrib/ci/debian_s390x.sh index 52617553c..c726ead09 100755 --- a/contrib/ci/debian_s390x.sh +++ b/contrib/ci/debian_s390x.sh @@ -18,6 +18,7 @@ meson setup .. \ --cross-file s390x_cross.txt \ --werror \ -Dplugin_flashrom=disabled \ + -Dplugin_uefi_capsule=disabled \ -Dplugin_modem_manager=disabled \ -Dintrospection=false \ -Dlibxmlb:introspection=false \ diff --git a/contrib/fwupd.spec.in b/contrib/fwupd.spec.in index e50ad4b01..6b4cf91d1 100644 --- a/contrib/fwupd.spec.in +++ b/contrib/fwupd.spec.in @@ -246,6 +246,11 @@ fwupd wrapper for Qubes OS %else -Dplugin_flashrom=disabled \ %endif +%if 0%{?have_uefi} + -Dplugin_uefi_capsule=enabled \ +%else + -Dplugin_uefi_capsule=disabled \ +%endif %if 0%{?have_modem_manager} -Dplugin_modem_manager=enabled \ %else diff --git a/data/meson.build b/data/meson.build index e5af936f1..d717319c0 100644 --- a/data/meson.build +++ b/data/meson.build @@ -110,7 +110,7 @@ if build_daemon if cc.has_header('linux/nvme_ioctl.h', required: false) device_allows += ['char-nvme'] endif - if allow_uefi_capsule + if get_option('plugin_uefi_capsule').allowed() # for BLKSSZGET device_allows += ['block-blkext'] endif diff --git a/meson.build b/meson.build index 7626fb567..baf5bde75 100644 --- a/meson.build +++ b/meson.build @@ -641,8 +641,7 @@ if dbusmock.returncode() != 0 and get_option('umockdev_tests').allowed() warning('python dbusmock not found, umockdev tests will be disabled') endif -allow_uefi_capsule = host_machine.system() in ['linux', 'freebsd'] and \ - host_machine.cpu_family() in ['x86', 'x86_64', 'aarch64', 'riscv64', 'loongarch64'] +allow_uefi_capsule = get_option('plugin_uefi_capsule').disable_auto_if(host_machine.system() not in ['linux', 'freebsd']).allowed() subdir('generate-build') subdir('libfwupd') diff --git a/meson_options.txt b/meson_options.txt index bf8e96433..74dc289f7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -137,6 +137,10 @@ option('plugin_modem_manager', type: 'feature', description: 'ModemManager support', ) +option('plugin_uefi_capsule', + type: 'feature', + description: 'UEFI capsule support', +) option('plugin_uefi_capsule_splash', type: 'boolean', value: true, diff --git a/plugins/uefi-capsule/README.md b/plugins/uefi-capsule/README.md index 425f88da2..3326cd76b 100644 --- a/plugins/uefi-capsule/README.md +++ b/plugins/uefi-capsule/README.md @@ -8,6 +8,9 @@ The Unified Extensible Firmware Interface (UEFI) is a specification that defines the software interface between an OS and platform firmware. With the UpdateCapsule boot service it can be used to update system firmware. +If you don't want or need this functionality you can use the +`-Dplugin_uefi_capsule=disabled` option. + When this plugin is enabled, the companion UEFI binary may also be built from the [fwupd-efi](https://github.com/fwupd/fwupd-efi) project if not already present on the filesystem by using the meson option `-Defi_binary=true`. For this companion binary to work with secure boot, it will need to be signed by an authority trusted with shim and/or the host environment. -- 2.49.0