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