Currently kdump doesn't support ipv6 nfs/ssh dump. Due to the lastet
version of the Internet Protocal, it is a significant feature for kdump
to enhance to support ipv6.
Following is the special config for ipv6 protocal.
For ipv6 nfs dump:
Link scope, /etc/kdump.conf should be specified like
"nfs [fe80::5054:ff:fe48:ca80%eth0]:/mnt"
otherwise
"nfs [2001:db8:0:f101::2]:/mnt"
For ipv6 ssh dump:
Link scope, /etc/kdump.conf should be edited like
"ssh root at fe80::5054:ff:fe48:ca80%eth0"
otherwise
"ssh root at 2001:db8:0:f101::2"
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 46 +++++++++++++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 17 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index f82aac7..4ac4c8f 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -301,24 +301,36 @@ kdump_install_net() {
local _server _netdev _srcaddr
local config_val="$1"
- _server=`echo $config_val | sed 's/.*@//' | cut -d':' -f1`
-
- _need_dns=`echo $_server|grep "[a-zA-Z]"`
- [ -n "$_need_dns" ] && _server=`getent hosts $_server|cut -d'
' -f1`
-
- _netdev=`/sbin/ip route get to $_server 2>&1`
- [ $? != 0 ] && echo "Bad kdump location: $config_val" &&
exit 1
-
- #the field in the ip output changes if we go to another subnet
- if [ -n "`echo $_netdev | grep via`" ]
- then
- # we are going to a different subnet
- _srcaddr=`echo $_netdev|awk '{print $7}'|head -n 1`
- _netdev=`echo $_netdev|awk '{print $5;}'|head -n 1`
+ _server=`get_remote_host $config_val`
+
+ is_hostname $_server && _server=`getent ahosts $_server|cut -d' '
-f1`
+
+ if is_ipv6_address $_server; then
+ _netdev=`/sbin/ip -6 route get to $_server 2>&1`
+ [ $? != 0 ] && echo "Bad kdump location: $config_val"
&& exit 1
+ #the field in the ip output changes if we go to another subnet
+ if [ -n "`echo $_netdev | grep via`" ]; then
+ # we are going to a different subnet
+ _srcaddr=`echo $_netdev|awk '{print $9}'|head -n 1`
+ _netdev=`echo $_netdev|awk '{print $7;}'|head -n 1`
+ else
+ # we are on the same subnet
+ _srcaddr=`echo $_netdev|awk '{print $7}'|head -n 1`
+ _netdev=`echo $_netdev|awk '{print $5}'|head -n 1`
+ fi
else
- # we are on the same subnet
- _srcaddr=`echo $_netdev|awk '{print $5}'|head -n 1`
- _netdev=`echo $_netdev|awk '{print $3}'|head -n 1`
+ _netdev=`/sbin/ip route get to $_server 2>&1`
+ [ $? != 0 ] && echo "Bad kdump location: $config_val"
&& exit 1
+ #the field in the ip output changes if we go to another subnet
+ if [ -n "`echo $_netdev | grep via`" ]; then
+ # we are going to a different subnet
+ _srcaddr=`echo $_netdev|awk '{print $7}'|head -n 1`
+ _netdev=`echo $_netdev|awk '{print $5;}'|head -n 1`
+ else
+ # we are on the same subnet
+ _srcaddr=`echo $_netdev|awk '{print $5}'|head -n 1`
+ _netdev=`echo $_netdev|awk '{print $3}'|head -n 1`
+ fi
fi
kdump_setup_netdev "${_netdev}" "${_srcaddr}"
"${_server}"
--
1.9.3