[meta-oe][PATCH 26/31] fwupd: Only enable hsi on x86

Khem Raj <[email protected]> Sat, 1 Aug 2026 14:45:21 -0700
Newsgroups org.openembedded.lists.openembedded-devel
Message-ID <[email protected]>
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 <[email protected]>
---
 meta-oe/recipes-bsp/fwupd/fwupd_2.1.7.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta-oe/recipes-bsp/fwupd/fwupd_2.1.7.bb b/meta-oe/recipes-bsp/fwupd/fwupd_2.1.7.bb
index 3a30b5d1ee..c144a52156 100644
--- a/meta-oe/recipes-bsp/fwupd/fwupd_2.1.7.bb
+++ b/meta-oe/recipes-bsp/fwupd/fwupd_2.1.7.bb
@@ -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"