Respect bonding mode

Update: use /sys/class/net/bondX/bonding/mode

We should set the mode of the bonding properly
in the second kernel too.

Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Cong Wang 2012-06-25 19:46:39 +08:00 committed by Dave Young
parent 469bdf2cae
commit f9c56b3f6e

View File

@ -67,14 +67,20 @@ kdump_setup_bridge() {
echo " bridge=$_netdev:$(cd /sys/class/net/$_netdev/brif/; echo * | sed -e 's/ /,/g')" >> ${initdir}/etc/cmdline.d/41bridge.conf
}
kdump_get_bond_mode() {
local _dev=$1
awk '{print $2}' /sys/class/net/$_dev/bonding/mode
}
kdump_setup_bond() {
local _netdev=$1
for _dev in `cat /sys/class/net/$_netdev/bonding/slaves`; do
echo -n " ifname=$_dev:$(kdump_get_mac_addr $_dev)" >> ${initdir}/etc/cmdline.d/42bond.conf
done
echo " bond=$_netdev:$(sed -e 's/ /,/g' /sys/class/net/$_netdev/bonding/slaves)" >> ${initdir}/etc/cmdline.d/42bond.conf
#TODO
#echo "bondoptions=\"$bondoptions\"" >> ${initdir}/etc/cmdline.d/42bond.conf
echo -n " bond=$_netdev:$(sed -e 's/ /,/g' /sys/class/net/$_netdev/bonding/slaves)" >> ${initdir}/etc/cmdline.d/42bond.conf
#TODO: get other options as well
bondoptions="mode=$(kdump_get_bond_mode $_netdev)"
echo " bondoptions=\"$bondoptions\"" >> ${initdir}/etc/cmdline.d/42bond.conf
}
kdump_setup_vlan() {