On Sun, Apr 25, 2021 at 04:57:48PM +0800, Kairui Song wrote:
On Sun, Apr 25, 2021 at 4:04 PM Coiby Xu <coxu(a)redhat.com>
wrote:
>
> This fix bz1854037 which happens because kexec-tools generates rd.route for
> eth0 instead of for kdump-eth0,
> 1. "rd.route=168.63.129.16:10.0.0.1:eth0
rd.route=169.254.169.254:10.0.0.1:eth0" is passed to the dracut cmdline by
kexec-tools
> 2. In the 2rd kernel,
> - dracut/modules.d/40network/net-lib.sh will write /tmp/net.route.eth0 based on
rd.route
> - dracut/modules.d/45ifcfg/write-ifcfg.sh will copy /tmp/net.route.eth0 to
/tmp/icfg and then copytree /tmp/ifcfg to
/run/initramfs/state/etc/sysconfig/network-scripts
> 3. NetworkManager will try to get an IP for eth0 regardless of the fact it's a
slave NIC and time out
> ```
> $ ip link show
> 2: kdump-eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
mode DEFAULT group default qlen 1000
> link/ether 00:0d:3a:11:86:8b brd ff:ff:ff:ff:ff:ff
> 3: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master
kdump-eth0 state UP mode DEFAULT group default qlen 1000
> ```
>
> Reported-by: Huijing Hei <hhei(a)redhat.com>
> Signed-off-by: Coiby Xu <coxu(a)redhat.com>
> ---
> dracut-module-setup.sh | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> index d1c2c8d..5b67f86 100755
> --- a/dracut-module-setup.sh
> +++ b/dracut-module-setup.sh
> @@ -235,7 +235,7 @@ cal_netmask_by_prefix() {
> #$2: srcaddr
> #if it use static ip echo it, or echo null
> kdump_static_ip() {
> - local _netdev="$1" _srcaddr="$2" _ipv6_flag
> + local _netdev="$1" _srcaddr="$2" kdumpnic="$3"
_ipv6_flag
> local _netmask _gateway _ipaddr _target _nexthop _prefix
>
> _ipaddr=$(ip addr show dev $_netdev permanent | awk "/ $_srcaddr\/.*
/{print \$2}")
> @@ -273,10 +273,10 @@ kdump_static_ip() {
> _target="[$_target]"
> _nexthop="[$_nexthop]"
> fi
> - echo "rd.route=$_target:$_nexthop:$_netdev"
> + echo "rd.route=$_target:$_nexthop:$kdumpnic"
> done >> ${initdir}/etc/cmdline.d/45route-static.conf
>
> - kdump_handle_mulitpath_route $_netdev $_srcaddr
> + kdump_handle_mulitpath_route $_netdev $_srcaddr $kdumpnic
> }
>
> kdump_handle_mulitpath_route() {
Hi, just found a small issue here, kdump_handle_mulitpath_route didn't
accept the kdumpnic as argument, if it worked, it's because kdumpnic
was kept in the environment, which is not a good practise.
I can fix it with following diff when merge it, so you don't have to
send the patch again:
kdump_handle_mulitpath_route() {
- local _netdev="$1" _srcaddr="$2" _ipv6_flag
+ local _netdev="$1" _srcaddr="$2" kdumpnic="$3"
_ipv6_flag
local _target _nexthop _route _weight _max_weight _rule
Is this ok to you?
Yes, it looks good to me. Thanks for spotting this issue and providing
the fix!
> @@ -299,9 +299,9 @@ kdump_handle_mulitpath_route() {
> _nexthop=`echo "$_route" | cut -d ' ' -f3`
> _max_weight=$_weight
> if [ "x" != "x"$_ipv6_flag ]; then
> - _rule="rd.route=[$_target]:[$_nexthop]:$_netdev"
> + _rule="rd.route=[$_target]:[$_nexthop]:$kdumpnic"
> else
> - _rule="rd.route=$_target:$_nexthop:$_netdev"
> + _rule="rd.route=$_target:$_nexthop:$kdumpnic"
> fi
> fi
> else
> @@ -491,7 +491,7 @@ kdump_install_net() {
> kdump_setup_znet $_netdev
> fi
>
> - _static=$(kdump_static_ip $_netdev $_srcaddr)
> + _static=$(kdump_static_ip $_netdev $_srcaddr $kdumpnic)
> if [ -n "$_static" ]; then
> _proto=none
> elif is_ipv6_address $_srcaddr; then
> --
> 2.31.1
> _______________________________________________
> kexec mailing list -- kexec(a)lists.fedoraproject.org
> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
> Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org
> Do not reply to spam on the list, report it:
https://pagure.io/fedora-infrastructure
--
Best Regards,
Kairui Song
--
Best regards,
Coiby