3b5284
From 7143750cf2e37f9c14ec47a8170b9186136874d7 Mon Sep 17 00:00:00 2001
3b5284
From: Beniamino Galvani <bgalvani@redhat.com>
3b5284
Date: Wed, 24 Jun 2020 13:09:04 +0200
3b5284
Subject: [PATCH] cms: regenerate NetworkManager connections
3b5284
3b5284
After changing the kernel command line, the cmsifup script calls ifup
3b5284
to activate the interface. However, ifup is only available in the
3b5284
network-legacy module; when using the network-manager module, we
3b5284
should regenerate connections according to the command line; then
3b5284
later NM will be run and will activate the device.
3b5284
3b5284
(cherry picked from commit 5c3d0a96473ac339fa2d1b25213b8f301c1cfd0d)
3b5284
3b5284
Resolves: #1847518
3b5284
---
3b5284
 modules.d/80cms/cmsifup.sh | 7 ++++++-
3b5284
 1 file changed, 6 insertions(+), 1 deletion(-)
3b5284
3b5284
diff --git a/modules.d/80cms/cmsifup.sh b/modules.d/80cms/cmsifup.sh
3b5284
index 902df8d8..77c18452 100755
3b5284
--- a/modules.d/80cms/cmsifup.sh
3b5284
+++ b/modules.d/80cms/cmsifup.sh
3b5284
@@ -35,4 +35,9 @@ fi
3b5284
 IFACES="$IFACES $DEVICE"
3b5284
 echo "$IFACES" >> /tmp/net.ifaces
3b5284
 
3b5284
-exec ifup "$DEVICE"
3b5284
+if [ -x /usr/libexec/nm-initrd-generator ]; then
3b5284
+    type nm_generate_connections >/dev/null 2>&1 || . /lib/nm-lib.sh
3b5284
+    nm_generate_connections
3b5284
+else
3b5284
+    exec ifup "$DEVICE"
3b5284
+fi
3b5284