]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
cms: regenerate NetworkManager connections
authorBeniamino Galvani <bgalvani@redhat.com>
Wed, 24 Jun 2020 11:09:04 +0000 (13:09 +0200)
committerHarald Hoyer <harald@hoyer.xyz>
Thu, 25 Jun 2020 08:58:34 +0000 (10:58 +0200)
After changing the kernel command line, the cmsifup script calls ifup
to activate the interface. However, ifup is only available in the
network-legacy module; when using the network-manager module, we
should regenerate connections according to the command line; then
later NM will be run and will activate the device.

modules.d/80cms/cmsifup.sh

index 902df8d8710c6cda3507f836593efb1617b1e0fe..77c18452df882c0c3f8026e4b2c9a563fa7cafc3 100755 (executable)
@@ -35,4 +35,9 @@ fi
 IFACES="$IFACES $DEVICE"
 echo "$IFACES" >> /tmp/net.ifaces
 
-exec ifup "$DEVICE"
+if [ -x /usr/libexec/nm-initrd-generator ]; then
+    type nm_generate_connections >/dev/null 2>&1 || . /lib/nm-lib.sh
+    nm_generate_connections
+else
+    exec ifup "$DEVICE"
+fi