]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network-manager: don't run NetworkManager when there are no connections
authorLubomir Rintel <lkundrak@v3.sk>
Mon, 2 Dec 2019 01:19:51 +0000 (02:19 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Tue, 14 Jan 2020 08:24:42 +0000 (09:24 +0100)
NetworkManager would unnecessarily bring up the devices, colliding with
further attempts to rename the devices.

This is arguably a NetworkManager bug and should eventually be fixed there.
Running NetworkManager without the connection is unnecessary regardless.

modules.d/35network-manager/nm-run.sh

index b33e099225ff6b66cccf5312c41bbbbeb5be66a0..4079b735253b50b03cce46a832615ff61d74d724 100755 (executable)
@@ -1,10 +1,17 @@
 #!/bin/sh
 
-if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
-    /usr/sbin/NetworkManager --configure-and-quit=initrd --debug --log-level=trace
-else
-    /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
-fi
+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
+  if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
+      /usr/sbin/NetworkManager --configure-and-quit=initrd --debug --log-level=trace
+  else
+      /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
+  fi
+  break
+done
 
 for _i in /sys/class/net/*
 do