]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(network-manager): depend on dbus only when using systemd
authorAndrew Gunnerson <accounts+github@chiller3.com>
Sun, 6 Jul 2025 04:21:53 +0000 (00:21 -0400)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Wed, 9 Jul 2025 01:32:31 +0000 (21:32 -0400)
network-manager does not require dbus to function when using the
--configure-and-quit=initrd option. This should be guaranteed as it is
documented behavior in the NetworkManager.conf(5) manpage and
specifically mentions dracut's use case.

With this change, initramfs images that don't or can't use systemd can
use network-manager instead of the old network-legacy module.

Fixes: #1422
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
modules.d/35network-manager/module-setup.sh

index 09107708cd0ae58d70de89a59683bc65a9e7f803..03a805750c93331db883d0843090083feb5ce7b6 100755 (executable)
@@ -10,7 +10,10 @@ check() {
 
 # called by dracut
 depends() {
-    echo dbus bash net-lib kernel-network-modules initqueue
+    echo bash net-lib kernel-network-modules initqueue
+    if dracut_module_included systemd; then
+        echo dbus
+    fi
     return 0
 }