fwupd: Only enable hsi on x86

fwupd 2.1.7 fails to configure on every non-x86 machine:

  ../sources/fwupd-2.1.7/meson.build:288:68: ERROR: Feature hsi cannot be enabled

HSI (Host Security ID) has always been implemented for x86 only, but the way
meson.build enforces that changed in 2.1.x. 2.0.19 had:

  hsi = get_option('hsi').disable_auto_if(host_machine.system() != 'linux').disable_auto_if(
    host_cpu != 'x86' and host_cpu != 'x86_64'
  ).allowed()

while 2.1.7 has:

  hsi = get_option('hsi').require(host_machine.system() == 'linux').require(
    host_cpu in ['x86', 'x86_64']
  ).allowed()

disable_auto_if() only downgrades features that are set to 'auto', so passing
-Dhsi=enabled on e.g. aarch64 used to go through silently. require() is an
assertion, so the same option is now a hard error.

The recipe lists hsi unconditionally in the default PACKAGECONFIG and therefore
always passes -Dhsi=enabled. Restrict that to the architectures whose meson
cpu_family is x86 or x86_64. Non-x86 now gets -Dhsi=disabled, and require() on
an explicitly disabled feature is a no-op rather than an error.

PACKAGECONFIG[hsi] is left alone so it can still be requested explicitly.

Verified on qemuarm64 (do_configure now succeeds, meson reports "hsi: disabled",
recipe builds through to packaging) and on qemux86-64 (hsi remains in
PACKAGECONFIG, so the feature is unchanged where it is supported).

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2026-07-29 11:43:35 -07:00
parent aad68a6567
commit ba6048b0ad
+5 -1
View File
@@ -40,8 +40,8 @@ PACKAGECONFIG ??= "\
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'bluetooth polkit', d)} \
${@bb.utils.contains_any('TARGET_ARCH', 'i386 i486 i586 i686 x86_64', 'hsi', '', d)} \
gnutls \
hsi \
plugin_modem_manager \
"
@@ -49,6 +49,10 @@ PACKAGECONFIG[bluetooth] = "-Dbluez=enabled,-Dbluez=disabled"
PACKAGECONFIG[firmware-packager] = "-Dfirmware-packager=true,-Dfirmware-packager=false"
PACKAGECONFIG[fish-completion] = "-Dfish_completion=true,-Dfish_completion=false"
PACKAGECONFIG[gnutls] = "-Dgnutls=enabled,-Dgnutls=disabled,gnutls"
# HSI is only implemented for x86. Since 2.1.x meson.build gates it with
# .require() rather than .disable_auto_if(), so asking for it anywhere else is a
# hard error ("Feature hsi cannot be enabled") instead of being quietly ignored,
# hence the architecture check on the default above.
PACKAGECONFIG[hsi] = "-Dhsi=enabled,-Dhsi=disabled"
PACKAGECONFIG[libdrm] = "-Dlibdrm=enabled,-Dlibdrm=disabled,libdrm"
PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false"