On 02/15/15 at 03:45pm, Minfei Huang wrote:
The ipv6 link scope (like: fe80::fab1:56ff:feb6:56d5%eth1) needs to
append the netdevice to identify the ipv6 address.
Due to add prefix "kdump-" before ethX(commit: ba7660f) in the 2nd
kernel, we should correct the mount parameter and /etc/kdump.conf to
add the prefix "kdump-" before ethX, if use the ipv6 link scope.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 20 ++++++++++++++++++++
mkdumprd | 16 +++++++++++++++-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index ff7a088..d09b339 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -339,6 +339,25 @@ default_dump_target_install_conf()
}
+kdump_ipv6_netdev_fixup()
+{
+ local _srcaddr _tmp_conf=$1
+ if is_ssh_dump_target; then
+ _srcaddr=$(get_option_value ssh)
+ elif is_nfs_dump_target; then
+ _srcaddr=$(get_option_value nfs)
+ fi
+
+ if [ "x" != "x"$_srcaddr ] && `echo $_srcaddr | grep -q
"%"`; then
+ local _netdev=${_srcaddr#*\%}
+ _netdev=${_netdev%]*}
+ local _pre_netdev=$(kdump_setup_ifname $_netdev)
_orig_netdev is better, don't stick to it much.
Otherwise this looks good.
+ if [ "x"$_netdev != "x"$_pre_netdev ];
then
+ sed -i "s#$_netdev#$_pre_netdev#" $_tmp_conf
+ fi
+ fi
+}
+
#install kdump.conf and what user specifies in kdump.conf
kdump_install_conf() {
sed -ne '/^#/!p' /etc/kdump.conf > /tmp/$$-kdump.conf
@@ -353,6 +372,7 @@ kdump_install_conf() {
;;
ssh|nfs)
kdump_install_net "$config_val"
+ kdump_ipv6_netdev_fixup "/tmp/$$-kdump.conf"
;;
kdump_pre|kdump_post|extra_bins)
dracut_install $config_val
diff --git a/mkdumprd b/mkdumprd
index 4d251ba..34bed63 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -78,8 +78,22 @@ add_dracut_module() {
add_dracut_arg "--add" "$1"
}
+# The ipv6 link scope which appends the netdevice to identify the ipv6
+# address is start with prefix "fe80", so we should correct the mount
+# parameter to add the prefix "kdump-" before ethX.
add_dracut_mount() {
- add_dracut_arg "--mount" "$1"
+ local _val="$1"
+
+ if is_nfs_dump_target; then
+ if `echo "$_val" | grep -q "^\[fe80"`; then
+ local _prefix="${_val%%\%*}"
+ local _netdev="${_val#*\%}"
+ _netdev=$(kdump_setup_ifname "$_netdev")
+ _val="$_prefix"%"$_netdev"
+ fi
+ fi
+
+ add_dracut_arg "--mount" "$_val"
}
add_dracut_sshkey() {
--
2.2.2