From: Laszlo Gombos Date: Thu, 2 Feb 2023 21:22:26 +0000 (+0000) Subject: fix(network,dbus): improve dependency checking X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f8f115a27b2bb63f0893262b6c951a187bac8ef;p=thirdparty%2Fdracut.git fix(network,dbus): improve dependency checking Decouple implementation details of the backend dependencies from the meta module. Call check_module for each submodule instead of reimplementing sub-package dependencies inside the meta module itself. Add missing NetworkManager binary to the network-manager dracut module check. --- diff --git a/modules.d/09dbus/module-setup.sh b/modules.d/09dbus/module-setup.sh index e3e1f16be..679483d3b 100755 --- a/modules.d/09dbus/module-setup.sh +++ b/modules.d/09dbus/module-setup.sh @@ -19,7 +19,7 @@ depends() { fi done - if find_binary dbus-broker &> /dev/null; then + if check_module "dbus-broker"; then echo "dbus-broker" return 0 else diff --git a/modules.d/35network-manager/module-setup.sh b/modules.d/35network-manager/module-setup.sh index c5d568f0b..d9a244a3f 100755 --- a/modules.d/35network-manager/module-setup.sh +++ b/modules.d/35network-manager/module-setup.sh @@ -2,7 +2,7 @@ # called by dracut check() { - require_binaries sed grep || return 1 + require_binaries sed grep NetworkManager || return 1 # do not add this module by default return 255 diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh index ba7104d9d..4c77ff329 100755 --- a/modules.d/40network/module-setup.sh +++ b/modules.d/40network/module-setup.sh @@ -17,11 +17,11 @@ depends() { done if [ -z "$network_handler" ]; then - if [[ -e $dracutsysrootdir$systemdsystemunitdir/connman.service ]]; then + if check_module "connman"; then network_handler="connman" - elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]] || [[ -x $dracutsysrootdir/usr/lib/nm-initrd-generator ]]; then + elif check_module "network-manager"; then network_handler="network-manager" - elif [[ -x $dracutsysrootdir$systemdutildir/systemd-networkd ]]; then + elif check_module "systemd-networkd"; then network_handler="systemd-networkd" else network_handler="network-legacy"