On 12/05/14 at 01:33pm, Minfei Huang wrote:
For ethX, the mapping of ethernet device name and MAC may change. It
will fail to setup the network in the 2nd kernel due to the flowing
ethX name.
The commit(ba7660f37e792be082b7e0c9e73b76647db5e902) has fixed this
issue.
To support static route, kdumpctl will write the config to tell the dracut
how to setup the network in the 2nd kernel.
Following the config format:
rd.route=192.168.201.215:192.168.200.137:eth1
In the 2nd kernel, the network device who names ethX may be different in
the 1st kernel. So we should identify the network device.
Add the prefix "kdump-" before the ethX in the static route config to
setup it successfully in the 2nd kernel.
Patch description usually contains 3 sections:
What happened or what's the problem
what's the root cause you figure out
How you fix it.
Sometime we don't mind if it's too long when you want to make it
clearer.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 9299b5d..6df7216 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -209,20 +209,25 @@ kdump_setup_znet() {
get_routes() {
local _netdev="$1" _target="$2"
- local _route
+ local _route _transit_target
Please use the common network term, I guess you mean the nexthop address
here for transit_target.
_route=`/sbin/ip route get to $_target 2>&1`
- if /sbin/ip route get to $_target | grep -q "via";
- then
+#
+# in the same subnet region, following is the route format
+# _route='192.168.200.137 dev eth1 src 192.168.200.129
+# cache '
+#
+# in the different subnet region, following is the route format
+# _route='192.168.201.215 via 192.168.200.137 dev eth1 src 192.168.200.129
+# cache '
You can put this code comment above function definition.
+#
+ if `echo $_route | grep -q "via"`; then
# route going to a different subnet via a router
- echo $_route | awk '{printf("rd.route=%s:%s:%s\n", $1, $3,
$5)}' \
- >> ${initdir}/etc/cmdline.d/45route-static.conf
- else
- # route going to a different subnet though directly connected
- echo $_route | awk '{printf("rd.route=%s::%s\n", $1, $3)}' \
- >> ${initdir}/etc/cmdline.d/45route-static.conf
+ _transit_target=`echo $_route | awk '{print $3}'`
fi
I like this idea, you just get nexthop if it's a different subnet target
ip.
Thanks
Baoquan
+ _netdev=$(kdump_setup_ifname $_netdev)
+ echo "rd.route=$_target:$_transit_target:$_netdev" >>
${initdir}/etc/cmdline.d/45route-static.conf
}
# Setup dracut to bringup a given network interface
--
1.8.3.1
_______________________________________________
kexec mailing list
kexec(a)lists.fedoraproject.org
https://lists.fedoraproject.org/mailman/listinfo/kexec