If one target address is not local and its route is different than default gateway, the specific route to this target address need be added.
In this patch, get the route to the specific target address and store it as cmdline, here is /etc/cmdline.d/45-route-static.conf. And the route options are separated by underscore like below. Then the sotred route can be parsed when kdump kernel boot up.
192.168.200.0/24_via_192.168.100.222_dev_ens10 --- dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 87ad072..f1d0d28 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -79,6 +79,11 @@ kdump_static_ip() { _gateway=$(ip route list dev $_netdev | awk '/^default /{print $3}') 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_%s_%s\n", $1, $2, $3, $4, $5)}' + done >> ${initdir}/etc/cmdline.d/45route-static.conf }
kdump_get_mac_addr() {
On Fri, Jun 27, 2014 at 04:43:05PM +0800, Baoquan He wrote:
If one target address is not local and its route is different than default gateway, the specific route to this target address need be added.
In this patch, get the route to the specific target address and store it as cmdline, here is /etc/cmdline.d/45-route-static.conf. And the route options are separated by underscore like below. Then the sotred route can be parsed when kdump kernel boot up.
192.168.200.0/24_via_192.168.100.222_dev_ens10
I think it is a good idea to quote one example of "ip route show" where there is one default route setting and one static route setting. I noticed that you gave an example to Harald in your mail conversation.
default via 192.168.122.1 dev eth0 proto static metric 1024 192.168.200.0/24 via 192.168.100.222 dev ens10 proto static metric 1
Also, has harald accepted your patch. Has things been sorted out with him for syntax of rd.route option?
Thanks Vivek
dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 87ad072..f1d0d28 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -79,6 +79,11 @@ kdump_static_ip() { _gateway=$(ip route list dev $_netdev | awk '/^default /{print $3}') 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_%s_%s\n", $1, $2, $3, $4, $5)}'
- done >> ${initdir}/etc/cmdline.d/45route-static.conf
}
kdump_get_mac_addr() {
1.9.0
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
Sorry, forgot replying your comments.
On 06/30/14 at 08:51am, Vivek Goyal wrote:
On Fri, Jun 27, 2014 at 04:43:05PM +0800, Baoquan He wrote:
If one target address is not local and its route is different than default gateway, the specific route to this target address need be added.
In this patch, get the route to the specific target address and store it as cmdline, here is /etc/cmdline.d/45-route-static.conf. And the route options are separated by underscore like below. Then the sotred route can be parsed when kdump kernel boot up.
192.168.200.0/24_via_192.168.100.222_dev_ens10
I think it is a good idea to quote one example of "ip route show" where there is one default route setting and one static route setting. I noticed that you gave an example to Harald in your mail conversation.
default via 192.168.122.1 dev eth0 proto static metric 1024 192.168.200.0/24 via 192.168.100.222 dev ens10 proto static metric 1
Yes, this is better to help understand the scenario. Will add this in new patch.
Also, has harald accepted your patch. Has things been sorted out with him for syntax of rd.route option?
Will sent a new version with change to initramfs because Harald pointed out my patch has an error on documentation. I guess he just doesn't like this, not sure about it. Will update if his different diea is clear.
Thanks Vivek
dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 87ad072..f1d0d28 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -79,6 +79,11 @@ kdump_static_ip() { _gateway=$(ip route list dev $_netdev | awk '/^default /{print $3}') 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_%s_%s\n", $1, $2, $3, $4, $5)}'
- done >> ${initdir}/etc/cmdline.d/45route-static.conf
}
kdump_get_mac_addr() {
1.9.0
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec