Skip to content

Commit

Permalink
fix(network-manager): rework how NM is started in debug mode
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lnykryn authored and haraldh committed Feb 19, 2021
1 parent 6f7823b commit 34c73b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 8 additions & 0 deletions modules.d/35network-manager/nm-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 1 addition & 5 deletions modules.d/35network-manager/nm-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 34c73b3

Please sign in to comment.