Adam Williamson adc431
From 319b21b51e7dc9343d4200e34252fc2e4d942c1f Mon Sep 17 00:00:00 2001
Adam Williamson adc431
From: Lubomir Rintel <lkundrak@v3.sk>
Adam Williamson adc431
Date: Mon, 27 May 2019 12:44:17 +0200
Adam Williamson adc431
Subject: [PATCH 1/3] network-manager: also read out next-server from NM state
Adam Williamson adc431
Adam Williamson adc431
---
Adam Williamson adc431
 modules.d/35network-manager/nm-run.sh | 2 +-
Adam Williamson adc431
 1 file changed, 1 insertion(+), 1 deletion(-)
Adam Williamson adc431
Adam Williamson adc431
diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
Adam Williamson adc431
index 0f9436316..c77f6074e 100755
Adam Williamson adc431
--- a/modules.d/35network-manager/nm-run.sh
Adam Williamson adc431
+++ b/modules.d/35network-manager/nm-run.sh
Adam Williamson adc431
@@ -11,7 +11,7 @@ do
Adam Williamson adc431
     state=/run/NetworkManager/devices/$(cat $_i/ifindex)
Adam Williamson adc431
     grep -q connection-uuid= $state 2>/dev/null || continue
Adam Williamson adc431
     ifname=$(basename $_i)
Adam Williamson adc431
-    sed -n 's/root-path/new_root_path/p' <$state >/tmp/dhclient.$ifname.dhcpopts
Adam Williamson adc431
+    sed -n 's/root-path/new_root_path/p;s/next-server/new_next_server/p' <$state >/tmp/dhclient.$ifname.dhcpopts
Adam Williamson adc431
     source_hook initqueue/online $ifname
Adam Williamson adc431
     /sbin/netroot $ifname
Adam Williamson adc431
 done
Adam Williamson adc431
Adam Williamson adc431
From ab24d818e206ab443d71194365d1d50c673a86e4 Mon Sep 17 00:00:00 2001
Adam Williamson adc431
From: Lubomir Rintel <lkundrak@v3.sk>
Adam Williamson adc431
Date: Mon, 27 May 2019 12:43:59 +0200
Adam Williamson adc431
Subject: [PATCH 2/3] network-manager: generate configuration with netroot=
Adam Williamson adc431
Adam Williamson adc431
If the root is on network, let nm-initrd-generator create configuration
Adam Williamson adc431
even if none was explicitly specified on the command line.
Adam Williamson adc431
Adam Williamson adc431
Also do the same if /tmp/net.ifaces exists, because the anaconda plugin
Adam Williamson adc431
creates an empty file in that location in hopes that will make us
Adam Williamson adc431
configure the network.
Adam Williamson adc431
---
Adam Williamson adc431
 modules.d/35network-manager/nm-config.sh | 4 ++++
Adam Williamson adc431
 1 file changed, 4 insertions(+)
Adam Williamson adc431
Adam Williamson adc431
diff --git a/modules.d/35network-manager/nm-config.sh b/modules.d/35network-manager/nm-config.sh
Adam Williamson adc431
index 1339ebe76..1efa737c5 100755
Adam Williamson adc431
--- a/modules.d/35network-manager/nm-config.sh
Adam Williamson adc431
+++ b/modules.d/35network-manager/nm-config.sh
Adam Williamson adc431
@@ -1,3 +1,7 @@
Adam Williamson adc431
 #!/bin/sh
Adam Williamson adc431
 
Adam Williamson adc431
+if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
Adam Williamson adc431
+    echo rd.neednet >> /etc/cmdline.d/35-neednet.conf
Adam Williamson adc431
+fi
Adam Williamson adc431
+
Adam Williamson adc431
 /usr/libexec/nm-initrd-generator -- $(getcmdline)
Adam Williamson adc431
Adam Williamson adc431
From 9a9c061fd70ce83191c6df5846bcb84559f46bf6 Mon Sep 17 00:00:00 2001
Adam Williamson adc431
From: Lubomir Rintel <lkundrak@v3.sk>
Adam Williamson adc431
Date: Mon, 27 May 2019 11:12:22 +0200
Adam Williamson adc431
Subject: [PATCH 3/3] network: parse root=dhcp also with network-manager module
Adam Williamson adc431
Adam Williamson adc431
Move the logic from network-legacy to common network code.
Adam Williamson adc431
---
Adam Williamson adc431
 modules.d/35network-legacy/module-setup.sh             | 1 -
Adam Williamson adc431
 modules.d/{35network-legacy => 40network}/dhcp-root.sh | 0
Adam Williamson adc431
 modules.d/40network/module-setup.sh                    | 1 +
Adam Williamson adc431
 3 files changed, 1 insertion(+), 1 deletion(-)
Adam Williamson adc431
 rename modules.d/{35network-legacy => 40network}/dhcp-root.sh (100%)
Adam Williamson adc431
Adam Williamson adc431
diff --git a/modules.d/35network-legacy/module-setup.sh b/modules.d/35network-legacy/module-setup.sh
Adam Williamson adc431
index 71abda36d..5a82e998c 100755
Adam Williamson adc431
--- a/modules.d/35network-legacy/module-setup.sh
Adam Williamson adc431
+++ b/modules.d/35network-legacy/module-setup.sh
Adam Williamson adc431
@@ -36,7 +36,6 @@ install() {
Adam Williamson adc431
     inst_simple -H "/etc/dhclient.conf"
Adam Williamson adc431
     cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"
Adam Williamson adc431
     inst_hook pre-udev 60 "$moddir/net-genrules.sh"
Adam Williamson adc431
-    inst_hook cmdline 91 "$moddir/dhcp-root.sh"
Adam Williamson adc431
     inst_hook cmdline 92 "$moddir/parse-ibft.sh"
Adam Williamson adc431
     inst_hook cmdline 95 "$moddir/parse-vlan.sh"
Adam Williamson adc431
     inst_hook cmdline 96 "$moddir/parse-bond.sh"
Adam Williamson adc431
diff --git a/modules.d/35network-legacy/dhcp-root.sh b/modules.d/40network/dhcp-root.sh
Adam Williamson adc431
similarity index 100%
Adam Williamson adc431
rename from modules.d/35network-legacy/dhcp-root.sh
Adam Williamson adc431
rename to modules.d/40network/dhcp-root.sh
Adam Williamson adc431
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
Adam Williamson adc431
index e8541636b..8e2a74a34 100755
Adam Williamson adc431
--- a/modules.d/40network/module-setup.sh
Adam Williamson adc431
+++ b/modules.d/40network/module-setup.sh
Adam Williamson adc431
@@ -28,6 +28,7 @@ install() {
Adam Williamson adc431
     inst_script "$moddir/netroot.sh" "/sbin/netroot"
Adam Williamson adc431
     inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
Adam Williamson adc431
     inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
Adam Williamson adc431
+    inst_hook cmdline 91 "$moddir/dhcp-root.sh"
Adam Williamson adc431
 
Adam Williamson adc431
     dracut_need_initqueue
Adam Williamson adc431
 }