]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(network-manager): rework how NM is started in debug mode
authorLukas Nykryn <lnykryn@redhat.com>
Wed, 10 Feb 2021 09:27:27 +0000 (10:27 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 19 Feb 2021 10:20:59 +0000 (11:20 +0100)
Instead of running directly NM with --debug, create a drop-in in
nm-config.sh. This will make sure, that we can get the debug output
regardless the way how NM will be started.

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

index 2b9df020057fbc302c9467076e10e2b590e45493..d27bd8cd5f9dede1c1a2a2b4fdb42c431c6a61cf 100755 (executable)
@@ -6,4 +6,12 @@ if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
     echo rd.neednet >> /etc/cmdline.d/35-neednet.conf
 fi
 
+if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
+    mkdir -m 0755 -p /run/NetworkManager/conf.d
+    (
+        echo '[logging]'
+        echo 'level=TRACE'
+    ) > /run/NetworkManager/conf.d/initrd-logging.conf
+fi
+
 nm_generate_connections
index 889dc64d792a6471ef706987e006458d3c1c49d7..8b3a06365e4560be36b62e228aee5779b3683838 100755 (executable)
@@ -9,11 +9,7 @@ for i in /usr/lib/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
+  /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
 
   if [ -s /run/NetworkManager/initrd/hostname ]; then
       cat /run/NetworkManager/initrd/hostname > /proc/sys/kernel/hostname