dracut/578.patch

93 lines
3.8 KiB
Diff

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