From: Beniamino Galvani Date: Wed, 4 Aug 2021 07:37:31 +0000 (+0200) Subject: fix(cms): reload NetworkManager connections X-Git-Tag: 056~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07977ee5c5294a5d30c1f33f292a0b31303750fb;p=thirdparty%2Fdracut.git fix(cms): reload NetworkManager connections When NetworkManager is running as systemd service, it's not enough to write connection files; the module should also tell NetworkManager to reload the connections from disk so that any new connection can be auto-activated. https://bugzilla.redhat.com/show_bug.cgi?id=1975929 --- diff --git a/modules.d/35network-manager/nm-lib.sh b/modules.d/35network-manager/nm-lib.sh index 2d27e0795..1f749587a 100644 --- a/modules.d/35network-manager/nm-lib.sh +++ b/modules.d/35network-manager/nm-lib.sh @@ -28,3 +28,7 @@ nm_generate_connections() { done fi } + +nm_reload_connections() { + [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active nm-initrd.service && nmcli connection reload +} diff --git a/modules.d/80cms/cmsifup.sh b/modules.d/80cms/cmsifup.sh index 73d76fbf2..285e20d12 100755 --- a/modules.d/80cms/cmsifup.sh +++ b/modules.d/80cms/cmsifup.sh @@ -37,6 +37,7 @@ echo "$IFACES" >> /tmp/net.ifaces if [ -x /usr/libexec/nm-initrd-generator ] || [ -x /usr/lib/nm-initrd-generator ]; then type nm_generate_connections > /dev/null 2>&1 || . /lib/nm-lib.sh nm_generate_connections + nm_reload_connections else exec ifup "$DEVICE" fi