]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network-manager: ensure that nm-run.sh is executed when needed
authorBeniamino Galvani <bgalvani@redhat.com>
Wed, 11 Mar 2020 08:40:50 +0000 (09:40 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Thu, 12 Mar 2020 10:42:37 +0000 (11:42 +0100)
The network-manager command line hook must install a
initqueue/finished hook to ensure that nm-run.sh is executed when
there are network connections to activate.

Fixes: #694
modules.d/35network-manager/nm-config.sh
modules.d/35network-manager/nm-run.sh

index 1efa737c5f6ae251d22507e98eafe4a3d48424c5..39a1c8bdf508fe7eac7e78050e240dd911c26a72 100755 (executable)
@@ -5,3 +5,14 @@ if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
 fi
 
 /usr/libexec/nm-initrd-generator -- $(getcmdline)
+
+if getargbool 0 rd.neednet; then
+  for i in /usr/lib/NetworkManager/system-connections/* \
+           /run/NetworkManager/system-connections/* \
+           /etc/NetworkManager/system-connections/* \
+           /etc/sysconfig/network-scripts/ifcfg-*; do
+    [ -f "$i" ] || continue
+    echo '[ -f /tmp/nm.done ]' >$hookdir/initqueue/finished/nm.sh
+    break
+  done
+fi
index 4079b735253b50b03cce46a832615ff61d74d724..fc5280a137904455ad89285d863444c2d6060923 100755 (executable)
@@ -22,3 +22,5 @@ do
     source_hook initqueue/online $ifname
     /sbin/netroot $ifname
 done
+
+> /tmp/nm.done