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