From f01f1a62ccaae5b486fd2359d322486ac489685f Mon Sep 17 00:00:00 2001 From: Laszlo Gombos Date: Wed, 18 Jan 2023 18:46:21 +0000 Subject: [PATCH] dracut: patch dracut-network meta module should check if module exists --- srcpkgs/dracut/patches/network.patch | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 srcpkgs/dracut/patches/network.patch diff --git a/srcpkgs/dracut/patches/network.patch b/srcpkgs/dracut/patches/network.patch new file mode 100644 index 000000000000..75a377797136 --- /dev/null +++ b/srcpkgs/dracut/patches/network.patch @@ -0,0 +1,35 @@ +From 11a34f6b55f91610effd79ff1bf6a4bb2db760d3 Mon Sep 17 00:00:00 2001 +From: Laszlo Gombos +Date: Wed, 18 Jan 2023 19:59:24 +0000 +Subject: [PATCH] meta module should check if module exists + +Bug: https://github.com/dracutdevs/dracut/issues/1756 +--- + modules.d/40network/module-setup.sh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index ba7104d9..8f9e5bff 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -17,13 +17,13 @@ depends() { + done + + if [ -z "$network_handler" ]; then +- if [[ -e $dracutsysrootdir$systemdsystemunitdir/connman.service ]]; then ++ if [[ -d "$dracutbasedir"/modules.d/35network-wicked ]] && [[ -e $dracutsysrootdir$systemdsystemunitdir/connman.service ]]; then + network_handler="connman" +- elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]] || [[ -x $dracutsysrootdir/usr/lib/nm-initrd-generator ]]; then ++ elif [[ -d "$dracutbasedir"/modules.d/35connman ]] && ( [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]] || [[ -x $dracutsysrootdir/usr/lib/nm-initrd-generator ]] ); then + network_handler="network-manager" +- elif [[ -x $dracutsysrootdir$systemdutildir/systemd-networkd ]]; then ++ elif [[ -d "$dracutbasedir"/modules.d/35network-manager ]] && [[ -x $dracutsysrootdir$systemdutildir/systemd-networkd ]]; then + network_handler="systemd-networkd" +- else ++ elif [[ -d "$dracutbasedir"/modules.d/35network-legacy ]]; then + network_handler="network-legacy" + fi + fi +-- +2.34.1 +