Skip to contentSkip to conversation

systemd: add missing dependency on libkmod to udev

PATCH New Ross Burton 1 participant 1 message Sep 12, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: add missing dependency on libkmod to udev

As of systemd 256, libsystemd-shared.so doesn't directly link to a number of libraries but instead dlopen()'s them as needed to reduce the size of the attack surface.

Instead the .so has a .note.dlopen segment that lists the libraries that may be opened, with the intention that these are transformed into package recommendation fields.

We don't yet have support for these (see #15595) so explicit dependencies have been added to the systemd package itself. However, in an initramfs with udev but without systemd and no recommendations you end up without libkmod, so module loading is impossible.

Add an explicit hard dependency on libkmod to udev, because modules are critical functionality.

---
 meta/recipes-core/systemd/systemd_256.5.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-core/systemd/systemd_256.5.bb +2 -0
index db053b45428..dc799f682ae 100644
@@ -743,6 +743,8 @@ INSANE_SKIP:libsystemd-shared += "libdir"
 FILES:libsystemd-shared = "${rootlibdir}/systemd/libsystemd-shared*.so"
 
 RPROVIDES:udev = "hotplug"
+# This can be removed when we parse .note.dlopen in the ELF
+RDEPENDS:udev += "libkmod"
 
 RDEPENDS:udev-bash-completion += "bash-completion"
 RDEPENDS:udev-hwdb += "udev"
Signature · 1 line
2.34.1