]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
systemd: break circular dependency with libfido2
authorDan McGregor <danmcgr@protonmail.com>
Mon, 16 Mar 2026 22:31:47 +0000 (16:31 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Mar 2026 10:57:13 +0000 (10:57 +0000)
libfido2 depends on udev, and when the fido2 feature is enabled
in systemd, systemd depends on libfido2. However, systemd really
only needs libfido2's headers at build time. It uses dlopen to
opportunistically enable the features at runtime. Break this
circular dependency by creating a recipe that provides libfido2's
headers and pkgconfig file. That allows systemd to build with
fido2 enabled and allows libfido2 do build as well.

Signed-off-by: Dan McGregor <danmcgr@protonmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/recipes-core/systemd/systemd/0001-meson-use-libfido2_cflags-dependency.patch [new file with mode: 0644]
meta/recipes-core/systemd/systemd_259.5.bb

diff --git a/meta/recipes-core/systemd/systemd/0001-meson-use-libfido2_cflags-dependency.patch b/meta/recipes-core/systemd/systemd/0001-meson-use-libfido2_cflags-dependency.patch
new file mode 100644 (file)
index 0000000..4bc1e10
--- /dev/null
@@ -0,0 +1,54 @@
+From 97142fd1db4124de5d5bdd3f49cc5a390286e522 Mon Sep 17 00:00:00 2001
+From: Dan McGregor <danmcgr@protonmail.com>
+Date: Wed, 11 Mar 2026 18:26:05 -0600
+Subject: [PATCH] meson: use libfido2_cflags dependency
+
+Add the libfido2 dependency to cryptenroll and cryptsetup's
+meson files. If libfido2's not installed in the default path
+the build wasn't finding its headers correctly.
+
+Signed-off-by: Dan McGregor <danmcgr@protonmail.com>
+Upstream-Status: Backport [https://github.com/systemd/systemd/commit/9ce905e35f690e7a10cd286be2b50594d0857f5e]
+---
+ src/cryptenroll/meson.build                  | 1 +
+ src/cryptsetup/cryptsetup-tokens/meson.build | 2 +-
+ src/cryptsetup/meson.build                   | 1 +
+ 3 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/cryptenroll/meson.build b/src/cryptenroll/meson.build
+index 488ceea14d..11265c8b41 100644
+--- a/src/cryptenroll/meson.build
++++ b/src/cryptenroll/meson.build
+@@ -23,6 +23,7 @@ executables += [
+                 'dependencies' : [
+                         libcryptsetup,
+                         libdl,
++                        libfido2_cflags,
+                         libopenssl,
+                         libp11kit_cflags,
+                 ],
+diff --git a/src/cryptsetup/cryptsetup-tokens/meson.build b/src/cryptsetup/cryptsetup-tokens/meson.build
+index 804e18bc67..0fd6309201 100644
+--- a/src/cryptsetup/cryptsetup-tokens/meson.build
++++ b/src/cryptsetup/cryptsetup-tokens/meson.build
+@@ -58,7 +58,7 @@ modules += [
+                 'sources' : cryptsetup_token_systemd_fido2_sources,
+                 'dependencies' : [
+                         libcryptsetup,
+-                        libfido2,
++                        libfido2_cflags,
+                 ],
+         },
+         template + {
+diff --git a/src/cryptsetup/meson.build b/src/cryptsetup/meson.build
+index d9778259c2..b36354fb0a 100644
+--- a/src/cryptsetup/meson.build
++++ b/src/cryptsetup/meson.build
+@@ -19,6 +19,7 @@ executables += [
+                 'sources' : systemd_cryptsetup_sources,
+                 'dependencies' : [
+                         libcryptsetup,
++                        libfido2_cflags,
+                         libmount_cflags,
+                         libopenssl,
+                         libp11kit_cflags,
index 6bc71c923f8ebe4341df1184b2eaa6bb113914ba..839414fd058cb4b4845ba3315b4a3359a5e7390c 100644 (file)
@@ -33,6 +33,7 @@ SRC_URI += " \
            file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
            file://0002-implment-systemd-sysv-install-for-OE.patch \
            file://0003-Do-not-create-var-log-README.patch \
+           file://0001-meson-use-libfido2_cflags-dependency.patch \
            "
 
 PAM_PLUGINS = " \
@@ -122,7 +123,7 @@ PACKAGECONFIG[default-compression-xz] = "-Dxz=true -Ddefault-compression=xz,,xz"
 PACKAGECONFIG[default-compression-zstd] = "-Dzstd=true -Ddefault-compression=zstd,,zstd"
 PACKAGECONFIG[efi] = "-Defi=true -Dbootloader=enabled,-Defi=false -Dbootloader=disabled,python3-pyelftools-native"
 PACKAGECONFIG[elfutils] = "-Delfutils=enabled,-Delfutils=disabled,elfutils,,libelf libdw"
-PACKAGECONFIG[fido] = "-Dlibfido2=enabled,-Dlibfido2=disabled,libfido2"
+PACKAGECONFIG[fido] = "-Dlibfido2=enabled,-Dlibfido2=disabled,libfido2-initial"
 PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
 PACKAGECONFIG[repart] = "-Drepart=enabled,-Drepart=disabled"
 PACKAGECONFIG[homed] = "-Dhomed=enabled,-Dhomed=disabled"