Talked with Dave Young, we decide to simplify the patch to only support non local ipv6 address from this patchset, and will support local ipv6 address in later patch. The reason why do this is it is hard to handle and review the patchset which supports both modes.
In order to make static ip work in Kdump, we shall merge the patch "dracut-module-setup: Apply the manual DNS to the 2nd kernel" firstly.
Minfe Huang (4): dracut-kdump: Use the first filtered ip address as dump directory dracut-module-setup: Support the network for ipv6 protocol dracut-module-setup: Prefer ipv4 address as the hostname address dracut-module-setup: Enhance ISCSI to support ipv6 protocol
dracut-kdump.sh | 4 +-- dracut-module-setup.sh | 78 +++++++++++++++++++++++++++++++++----------------- kdump-lib.sh | 29 +++++++++++++++++++ 3 files changed, 83 insertions(+), 28 deletions(-)
For now, Kdump will use ipv4 address as dump directory, and it works, if ipv4 is enabled.
Once Kdump start to support ipv6 protocol, we may only setup the ipv6 address exclusively. Modify the code to make Kdump work in either ipv4 and ipv6 protocol.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com --- dracut-kdump.sh | 4 ++-- dracut-module-setup.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh index dc948d1..4aab205 100755 --- a/dracut-kdump.sh +++ b/dracut-kdump.sh @@ -121,9 +121,9 @@ get_host_ip() then kdumpnic=$(getarg kdumpnic=) [ -z "$kdumpnic" ] && echo "kdump: failed to get kdumpnic!" && return 1 - _host=`ip addr show dev $kdumpnic|grep 'inet '` + _host=`ip addr show dev $kdumpnic|grep '[ ]*inet'` [ $? -ne 0 ] && echo "kdump: wrong kdumpnic: $kdumpnic" && return 1 - _host="${_host##*inet }" + _host=`echo $_host | head -n 1 | cut -d' ' -f2` _host="${_host%%/*}" [ -z "$_host" ] && echo "kdump: wrong kdumpnic: $kdumpnic" && return 1 HOST_IP=$_host diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 3eb80c0..66394e6 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -658,6 +658,7 @@ install() { inst "/bin/date" "/bin/date" inst "/bin/sync" "/bin/sync" inst "/bin/cut" "/bin/cut" + inst "/bin/head" "/bin/head" inst "/sbin/makedumpfile" "/sbin/makedumpfile" inst "/sbin/vmcore-dmesg" "/sbin/vmcore-dmesg" inst "/lib/kdump/kdump-lib.sh" "/lib/kdump-lib.sh"
Previously, Kdump will save route to setup the network route in the 2nd kernel for ipv4 protocol. To support ipv6 protocol, make Kdump fetch correct nexthop, since the ruturning format is different.
In order to enhance kdump to support ipv6, support the static ip for ipv6 protocol, which ipv4 has supported already.
Introduce a new lib function get_remote_host which is used to factor out the ip address(ipv4 or ipv6) and hostname in /etc/kdump.conf.
Introduce a new lib function is_ipv6_address which is used to make sure whether the passed ip address is ipv4 or ipv6.
Introduce a new lib function is_hostname which is used to confirm whether the passed parameter is hostname, not the ip address.
Introduce a new function get_ip_route_field which is used to factor out the specified string in ip route info.
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com --- dracut-module-setup.sh | 67 +++++++++++++++++++++++++++++++------------------- kdump-lib.sh | 29 ++++++++++++++++++++++ 2 files changed, 71 insertions(+), 25 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 66394e6..3d2636e 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -89,19 +89,38 @@ kdump_setup_dns() { #$2: srcaddr #if it use static ip echo it, or echo null kdump_static_ip() { - local _netmask _gateway - local _netdev="$1" _srcaddr="$2" - local _ipaddr=$(ip addr show dev $_netdev permanent | \ - awk "/ $_srcaddr/.* $_netdev$/{print $2}") + local _netdev="$1" _srcaddr="$2" _ipv6_flag + local _netmask _gateway _ipaddr _target _nexthop + + _ipaddr=$(ip addr show dev $_netdev | awk "/ $_srcaddr/.* /{print $2}") + + if is_ipv6_address $_srcaddr; then + _ipv6_flag="-6" + fi + if [ -n "$_ipaddr" ]; then - _netmask=$(ipcalc -m $_ipaddr | cut -d'=' -f2) - _gateway=$(ip route list dev $_netdev | awk '/^default /{print $3}') - echo -n "${_srcaddr}::${_gateway}:${_netmask}::" + _gateway=$(ip $_ipv6_flag route list dev $_netdev | awk '/^default /{print $3}') + + if [ "x" != "x"$_ipv6_flag ]; then + # _ipaddr="2002::56ff:feb6:56d5/64", _netmask is the number after "/" + _netmask=${_ipaddr#*/} + _srcaddr="[$_srcaddr]" + _gateway="[$_gateway]" + else + _netmask=$(ipcalc -m $_ipaddr | cut -d'=' -f2) + fi + echo -n "${_srcaddr}::${_gateway}:${_netmask}::" fi
- /sbin/ip route show | grep -v default | grep "^[[:digit:]].*via.* $_netdev " |\ - while read line; do - echo $line | awk '{printf("rd.route=%s:%s:%s\n", $1, $3, $5)}' + /sbin/ip $_ipv6_flag route show | grep -v default | grep ".*via.* $_netdev " |\ + while read _route; do + _target=`echo $_route | cut -d ' ' -f1` + _nexthop=`echo $_route | cut -d ' ' -f3` + if [ "x" != "x"$_ipv6_flag ]; then + _target="[$_target]" + _nexthop="[$_nexthop]" + fi + echo "rd.route=$_target:$_nexthop:$_netdev" done >> ${initdir}/etc/cmdline.d/45route-static.conf }
@@ -276,32 +295,30 @@ kdump_setup_netdev() { kdump_setup_dns "$_netdev" }
+get_ip_route_field() +{ + if `echo $1 | grep -q $2`; then + echo ${1##*$2} | cut -d ' ' -f1 + fi +} + #Function:kdump_install_net #$1: config values of net line in kdump.conf #$2: srcaddr of network device kdump_install_net() { - local _server _netdev _srcaddr + local _server _netdev _srcaddr _route local config_val="$1"
- _server=`echo $config_val | sed 's/.*@//' | cut -d':' -f1` + _server=$(get_remote_host $config_val)
- _need_dns=`echo $_server|grep "[a-zA-Z]"` - [ -n "$_need_dns" ] && _server=`getent hosts $_server|cut -d' ' -f1` + is_hostname $_server && _server=`getent hosts $_server | head -n 1 | cut -d' ' -f1`
- _netdev=`/sbin/ip route get to $_server 2>&1` + _route=`/sbin/ip -o 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 + _srcaddr=$(get_ip_route_field "$_route" "src") + _netdev=$(get_ip_route_field "$_route" "dev")
kdump_setup_netdev "${_netdev}" "${_srcaddr}"
diff --git a/kdump-lib.sh b/kdump-lib.sh index e62b4e2..4d34206 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -201,3 +201,32 @@ is_atomic() { grep -q "ostree" /proc/cmdline } + +is_ipv6_address() +{ + echo $1 | grep -q ":" +} + +# get ip address or hostname from nfs/ssh config value +get_remote_host() +{ + local _config_val=$1 + + # ipv6 address in kdump.conf is around with "[]", + # factor out the ipv6 address + _config_val=${_config_val#*@} + _config_val=${_config_val%:/*} + _config_val=${_config_val#[} + _config_val=${_config_val%]} + echo $_config_val +} + +is_hostname() +{ + local _hostname=`echo $1 | grep ":"` + + if [ -n "$_hostname" ]; then + return 1 + fi + echo $1 | grep -q "[a-zA-Z]" +}
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Previously, Kdump will save route to setup the network route in the 2nd kernel for ipv4 protocol. To support ipv6 protocol, make Kdump fetch correct nexthop, since the ruturning format is different.
In order to enhance kdump to support ipv6, support the static ip for ipv6 protocol, which ipv4 has supported already.
Introduce a new lib function get_remote_host which is used to factor out the ip address(ipv4 or ipv6) and hostname in /etc/kdump.conf.
Introduce a new lib function is_ipv6_address which is used to make sure whether the passed ip address is ipv4 or ipv6.
Introduce a new lib function is_hostname which is used to confirm whether the passed parameter is hostname, not the ip address.
Introduce a new function get_ip_route_field which is used to factor out the specified string in ip route info.
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com
dracut-module-setup.sh | 67 +++++++++++++++++++++++++++++++------------------- kdump-lib.sh | 29 ++++++++++++++++++++++ 2 files changed, 71 insertions(+), 25 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 66394e6..3d2636e 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -89,19 +89,38 @@ kdump_setup_dns() { #$2: srcaddr #if it use static ip echo it, or echo null kdump_static_ip() {
- local _netmask _gateway
- local _netdev="$1" _srcaddr="$2"
- local _ipaddr=$(ip addr show dev $_netdev permanent | \
awk "/ $_srcaddr\/.* $_netdev\$/{print \$2}")
- local _netdev="$1" _srcaddr="$2" _ipv6_flag
- local _netmask _gateway _ipaddr _target _nexthop
- _ipaddr=$(ip addr show dev $_netdev | awk "/ $_srcaddr/.* /{print $2}")
- if is_ipv6_address $_srcaddr; then
_ipv6_flag="-6"
- fi
- if [ -n "$_ipaddr" ]; then
_netmask=$(ipcalc -m $_ipaddr | cut -d'=' -f2)
_gateway=$(ip route list dev $_netdev | awk '/^default /{print $3}')
echo -n "${_srcaddr}::${_gateway}:${_netmask}::"
_gateway=$(ip $_ipv6_flag route list dev $_netdev | awk '/^default /{print $3}')
if [ "x" != "x"$_ipv6_flag ]; then
# _ipaddr="2002::56ff:feb6:56d5/64", _netmask is the number after "/"
_netmask=${_ipaddr#*\/}
_srcaddr="[$_srcaddr]"
_gateway="[$_gateway]"
else
_netmask=$(ipcalc -m $_ipaddr | cut -d'=' -f2)
fi
fiecho -n "${_srcaddr}::${_gateway}:${_netmask}::"
- /sbin/ip route show | grep -v default | grep "^[[:digit:]].*via.* $_netdev " |\
- while read line; do
echo $line | awk '{printf("rd.route=%s:%s:%s\n", $1, $3, $5)}'
- /sbin/ip $_ipv6_flag route show | grep -v default | grep ".*via.* $_netdev " |\
- while read _route; do
_target=`echo $_route | cut -d ' ' -f1`
_nexthop=`echo $_route | cut -d ' ' -f3`
if [ "x" != "x"$_ipv6_flag ]; then
_target="[$_target]"
_nexthop="[$_nexthop]"
fi
done >> ${initdir}/etc/cmdline.d/45route-static.confecho "rd.route=$_target:$_nexthop:$_netdev"
}
@@ -276,32 +295,30 @@ kdump_setup_netdev() { kdump_setup_dns "$_netdev" }
+get_ip_route_field() +{
- if `echo $1 | grep -q $2`; then
echo ${1##*$2} | cut -d ' ' -f1
- fi
+}
#Function:kdump_install_net #$1: config values of net line in kdump.conf #$2: srcaddr of network device kdump_install_net() {
- local _server _netdev _srcaddr
- local _server _netdev _srcaddr _route local config_val="$1"
- _server=`echo $config_val | sed 's/.*@//' | cut -d':' -f1`
- _server=$(get_remote_host $config_val)
- _need_dns=`echo $_server|grep "[a-zA-Z]"`
- [ -n "$_need_dns" ] && _server=`getent hosts $_server|cut -d' ' -f1`
- is_hostname $_server && _server=`getent hosts $_server | head -n 1 | cut -d' ' -f1`
- _netdev=`/sbin/ip route get to $_server 2>&1`
_route=`/sbin/ip -o 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
_srcaddr=$(get_ip_route_field "$_route" "src")
_netdev=$(get_ip_route_field "$_route" "dev")
kdump_setup_netdev "${_netdev}" "${_srcaddr}"
diff --git a/kdump-lib.sh b/kdump-lib.sh index e62b4e2..4d34206 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -201,3 +201,32 @@ is_atomic() { grep -q "ostree" /proc/cmdline }
+is_ipv6_address() +{
- echo $1 | grep -q ":"
+}
+# get ip address or hostname from nfs/ssh config value +get_remote_host() +{
- local _config_val=$1
- # ipv6 address in kdump.conf is around with "[]",
- # factor out the ipv6 address
- _config_val=${_config_val#*@}
- _config_val=${_config_val%:/*}
- _config_val=${_config_val#[}
- _config_val=${_config_val%]}
- echo $_config_val
+}
+is_hostname() +{
- local _hostname=`echo $1 | grep ":"`
- if [ -n "$_hostname" ]; then
return 1
- fi
- echo $1 | grep -q "[a-zA-Z]"
+}
2.1.0
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
Ack
Thanks Dave
Kdump will parse the hostname to get the ip address, if hostname is specfied in /etc/kdump.conf. We will get the ip address(ipv4 or ipv6, according to the DNS server) by using "getent hosts".
For now, it is more reasonable that we shall get all of the ip address(including ipv4 and ipv6 address) which point to the hostname by using "getent ahosts". And we will prefer to use the ipv4 address, if both ipv4 and ipv6 address work.
The reason why we choose the ipv4 as preferred address is to solve the issue kdump will fail to connect the hostname machine(parsed as ipv6 address), due to the DNS server is ipv4 address in 2nd kernel.
Signed-off-by: Minfei Huang mhuang@redhat.com --- dracut-module-setup.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 3d2636e..04a2e15 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -306,12 +306,18 @@ get_ip_route_field() #$1: config values of net line in kdump.conf #$2: srcaddr of network device kdump_install_net() { - local _server _netdev _srcaddr _route + local _server _netdev _srcaddr _route _serv_tmp local config_val="$1"
_server=$(get_remote_host $config_val)
- is_hostname $_server && _server=`getent hosts $_server | head -n 1 | cut -d' ' -f1` + if is_hostname $_server; then + _serv_tmp=`getent ahosts $_server | grep -v : | head -n 1` + if [ -z "$_serv_tmp" ]; then + _serv_tmp=`getent ahosts $_server | head -n 1` + fi + _server=`echo $_serv_tmp | cut -d' ' -f1` + fi
_route=`/sbin/ip -o route get to $_server 2>&1` [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Kdump will parse the hostname to get the ip address, if hostname is specfied in /etc/kdump.conf. We will get the ip address(ipv4 or ipv6, according to the DNS server) by using "getent hosts".
For now, it is more reasonable that we shall get all of the ip address(including ipv4 and ipv6 address) which point to the hostname by using "getent ahosts". And we will prefer to use the ipv4 address, if both ipv4 and ipv6 address work.
The reason why we choose the ipv4 as preferred address is to solve the issue kdump will fail to connect the hostname machine(parsed as ipv6 address), due to the DNS server is ipv4 address in 2nd kernel.
Signed-off-by: Minfei Huang mhuang@redhat.com
dracut-module-setup.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 3d2636e..04a2e15 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -306,12 +306,18 @@ get_ip_route_field() #$1: config values of net line in kdump.conf #$2: srcaddr of network device kdump_install_net() {
- local _server _netdev _srcaddr _route
local _server _netdev _srcaddr _route _serv_tmp local config_val="$1"
_server=$(get_remote_host $config_val)
- is_hostname $_server && _server=`getent hosts $_server | head -n 1 | cut -d' ' -f1`
if is_hostname $_server; then
_serv_tmp=`getent ahosts $_server | grep -v : | head -n 1`
if [ -z "$_serv_tmp" ]; then
_serv_tmp=`getent ahosts $_server | head -n 1`
fi
_server=`echo $_serv_tmp | cut -d' ' -f1`
fi
_route=`/sbin/ip -o route get to $_server 2>&1` [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
-- 2.1.0
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
Ack
Thanks Dave
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com --- dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line - # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
+ if is_ipv6_address $tgt_ipaddr; then + tgt_ipaddr="[$tgt_ipaddr]" + fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
-- Thanks Dave
On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Due to the limitation of the hardware, we do not test the iscsi to support ipv6, just to satisfy the format to dracut.
I think I told you before about it.
Thanks Minfei
On 07/24/15 at 10:31am, Minfei Huang wrote:
On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Due to the limitation of the hardware, we do not test the iscsi to support ipv6, just to satisfy the format to dracut.
I think I told you before about it.
But from above code, it will apparently not work for iscsi, the field order is not same between ipv4 and ipv6.
On 07/24/15 at 11:24am, Dave Young wrote:
On 07/24/15 at 10:31am, Minfei Huang wrote:
On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Due to the limitation of the hardware, we do not test the iscsi to support ipv6, just to satisfy the format to dracut.
I think I told you before about it.
But from above code, it will apparently not work for iscsi, the field order is not same between ipv4 and ipv6.
Yes. will modify it to make kdump support iscsi via ipv6 protocol.
Thanks Minfei
On 07/24/15 at 10:31am, Minfei Huang wrote:
On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Due to the limitation of the hardware, we do not test the iscsi to support ipv6, just to satisfy the format to dracut.
I think I told you before about it.
The code is for software iscsi so you only need test soft iscsi...
On 07/24/15 at 11:25am, Dave Young wrote:
On 07/24/15 at 10:31am, Minfei Huang wrote:
On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Due to the limitation of the hardware, we do not test the iscsi to support ipv6, just to satisfy the format to dracut.
I think I told you before about it.
The code is for software iscsi so you only need test soft iscsi...
Ok. I will test the software iscsi to confirm it.
Thanks Minfei
On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Hi, Dave.
Kdump can fetch the parameters from the iscsi session successfully using above code with both ipv4 and ipv6 protocol.
Here are example for ipv4 and ipv6 protocol.
[root@intel-sugarbay-dh-02 99kdumpbase]# /sbin/ip route get to 2620:52:0:102f:21e:67ff:fe65:9608 2620:52:0:102f:21e:67ff:fe65:9608 from :: via fe80:52:0:13b0::7fe dev em1 src 2620:52:0:13b0:213:20ff:fef9:ad92 metric 0 cache hoplimit 64
[root@intel-sugarbay-dh-02 99kdumpbase]# /sbin/ip route get to 10.16.44.98 10.16.44.98 via 10.19.183.254 dev em1 src 10.19.176.36 cache
Thanks Minfei
On 07/27/15 at 03:56pm, Minfei Huang wrote:
On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Hi, Dave.
Kdump can fetch the parameters from the iscsi session successfully using above code with both ipv4 and ipv6 protocol.
What do you mean "Kdump can fetch ...", do not need a fix?
srcaddr is right in case ipv6?
Here are example for ipv4 and ipv6 protocol.
[root@intel-sugarbay-dh-02 99kdumpbase]# /sbin/ip route get to 2620:52:0:102f:21e:67ff:fe65:9608 2620:52:0:102f:21e:67ff:fe65:9608 from :: via fe80:52:0:13b0::7fe dev em1 src 2620:52:0:13b0:213:20ff:fef9:ad92 metric 0 cache hoplimit 64
[root@intel-sugarbay-dh-02 99kdumpbase]# /sbin/ip route get to 10.16.44.98 10.16.44.98 via 10.19.183.254 dev em1 src 10.19.176.36 cache
Thanks Minfei
On 07/27/15 at 04:09pm, Dave Young wrote:
On 07/27/15 at 03:56pm, Minfei Huang wrote:
On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Hi, Dave.
Kdump can fetch the parameters from the iscsi session successfully using above code with both ipv4 and ipv6 protocol.
What do you mean "Kdump can fetch ...", do not need a fix?
srcaddr is right in case ipv6?
Kdump can get the parameters from the iscsi session successfully.
Yes, we can get the right value for srcaddr.
Thanks Minfei
Here are example for ipv4 and ipv6 protocol.
[root@intel-sugarbay-dh-02 99kdumpbase]# /sbin/ip route get to 2620:52:0:102f:21e:67ff:fe65:9608 2620:52:0:102f:21e:67ff:fe65:9608 from :: via fe80:52:0:13b0::7fe dev em1 src 2620:52:0:13b0:213:20ff:fef9:ad92 metric 0 cache hoplimit 64
[root@intel-sugarbay-dh-02 99kdumpbase]# /sbin/ip route get to 10.16.44.98 10.16.44.98 via 10.19.183.254 dev em1 src 10.19.176.36 cache
Thanks Minfei
On 07/27/15 at 05:05pm, Minfei Huang wrote:
On 07/27/15 at 04:09pm, Dave Young wrote:
On 07/27/15 at 03:56pm, Minfei Huang wrote:
On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Hi, Dave.
Kdump can fetch the parameters from the iscsi session successfully using above code with both ipv4 and ipv6 protocol.
What do you mean "Kdump can fetch ...", do not need a fix?
srcaddr is right in case ipv6?
Kdump can get the parameters from the iscsi session successfully.
Yes, we can get the right value for srcaddr.
Ok, it is good news, so I think this series are good to me now. Once iscsi test passed I can merge them into Fedora suppose there's no other comments.
Thanks Dave
----- Original Message -----
From: "Dave Young" dyoung@redhat.com To: "Minfei Huang" mhuang@redhat.com Cc: kexec@lists.fedoraproject.org Sent: Monday, July 27, 2015 5:10:52 PM Subject: Re: [PATCH v15 4/4] dracut-module-setup: Enhance ISCSI to support ipv6 protocol
On 07/27/15 at 05:05pm, Minfei Huang wrote:
On 07/27/15 at 04:09pm, Dave Young wrote:
On 07/27/15 at 03:56pm, Minfei Huang wrote:
On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
Due to the different format between ipv4 and ipv6 protocol, quote the ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Dave Young dyoung@redhat.com
dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 04a2e15..2a0d93f 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() { kdump_setup_netdev $netdev $srcaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc.
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev (.*).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Hi, Dave.
Kdump can fetch the parameters from the iscsi session successfully using above code with both ipv4 and ipv6 protocol.
What do you mean "Kdump can fetch ...", do not need a fix?
srcaddr is right in case ipv6?
Kdump can get the parameters from the iscsi session successfully.
Yes, we can get the right value for srcaddr.
Ok, it is good news, so I think this series are good to me now. Once iscsi test passed I can merge them into Fedora suppose there's no other comments.
Hi
Ok, from my test, I think there is no problem.
Thanks Chao Fan
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec