kdump/kdump-initrd-network.patch

60 lines
1.8 KiB
Diff
Raw Normal View History

From: Julian Wolf <juwolf@suse.com>
Subject: Added dracut network activation in initrd to mkdumprd
Patch-mainline: not yet
Acked-by: Petr Tesarik <ptesarik@suse.cz>
---
init/mkdumprd | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
--- a/init/mkdumprd
+++ b/init/mkdumprd
@@ -119,10 +119,34 @@ function run_mkinitrd()
# Create a new initrd using dracut {{{
function run_dracut()
{
+ local modules="kdump"
+
. /lib/kdump/setup-kdump.functions
DRACUT_ARGS="--force --hostonly --omit 'systemd plymouth resume usrmount'"
+ # network configuration
+ if [ "$KDUMP_NETCONFIG" = "auto" ] ; then
+ status_message "Network: auto"
+ DRACUT_ARGS+=" --kernel-cmdline 'rd.neednet=1 ip=any'"
+ modules="$modules network"
+ elif [ -z "$KDUMP_NETCONFIG" ] ; then
+ status_message "Network: none"
+ else
+ interface=$(echo "$KDUMP_NETCONFIG" | cut -d ':' -f 1)
+ mode=$(echo "$KDUMP_NETCONFIG" | cut -d ':' -f 2)
+
+ status_message "Network interface: $interface"
+ if [ "$mode" = "static" ] ; then
+ status_message "Network mode: Static IP"
+ DRACUT_ARGS+=" --kernel-cmdline 'rd.neednet=1'"
+ else
+ status_message "Network mode: Automatic IP (DHCP)"
+ DRACUT_ARGS+=" --kernel-cmdline 'rd.neednet=1 ip=${interface}:dhcp'"
+ fi
+ modules="$modules network"
+ fi
+
# add mount points
kdump_get_mountpoints || return 1
i=0
@@ -135,8 +159,10 @@ function run_dracut()
done
# Check for additional modules
- modules="kdump"
for protocol in "${kdump_Protocol[@]}" ; do
+ if [ "$protocol" = "nfs" ]; then
+ modules="$modules nfs"
+ fi
if [ "$protocol" = "cifs" -o "$protocol" = "smb" ]; then
modules="$modules cifs"
fi