Skip to content

Commit

Permalink
fix(network,dbus): improve dependency checking
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LaszloGombos committed Jun 9, 2023
1 parent cd6f683 commit 3f8f115
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules.d/09dbus/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules.d/35network-manager/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions modules.d/40network/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3f8f115

Please sign in to comment.