module-setup: Use proper ethernet device name in 2nd kernel
For ethX, it may fail to setup the network in the 2nd kernel due to the
mapping of ethernet device name and MAC changes.
The commit(ba7660f37e
) has fixed this
issue by add the prefix "kdump-" before ethX. But the network will fail
to work in the static route mode because of this commit.
Here is the config which is used to setup the static route:
rd.route=192.168.201.215:192.168.200.137:eth1
Obviously, the static route config comtains the ethX. But the network
device names kdump-ethX in the 2nd kernel, so the static route config
will fail to execute. To fix it, 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.
Signed-off-by: Minfei Huang <mhuang@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
This commit is contained in:
parent
d94c354e81
commit
08809fb0c7
@ -209,20 +209,25 @@ kdump_setup_znet() {
|
||||
|
||||
get_routes() {
|
||||
local _netdev="$1" _target="$2"
|
||||
local _route
|
||||
local _route _nexthop
|
||||
|
||||
_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 '
|
||||
#
|
||||
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
|
||||
_nexthop=`echo $_route | awk '{print $3}'`
|
||||
fi
|
||||
_netdev=$(kdump_setup_ifname $_netdev)
|
||||
|
||||
echo "rd.route=$_target:$_nexthop:$_netdev" >> ${initdir}/etc/cmdline.d/45route-static.conf
|
||||
}
|
||||
|
||||
# Setup dracut to bringup a given network interface
|
||||
|
Loading…
Reference in New Issue
Block a user