From 0455b7035eb6da05cd2b39c641e835058bd705a7 Mon Sep 17 00:00:00 2001 From: WANG Chao Date: Mon, 8 Apr 2013 18:02:20 +0800 Subject: [PATCH] Fix bonding options syntax and get all specified options from ifcfg file. drauct takes bond=[::[:]] syntax to parse bond. For example: bond=bond0:eth0,eth1:mode=balance-rr Update v2: - Get bonding options from corresponding ifcfg. Because it's hard to keep track of all the runtime configurable options under /sys/class/net/$netif/ - Remove kdump_get_bond_mode, since it's useless now. Signed-off-by: WANG Chao Acked-by: Dave Young Acked-by: Baoquan He --- dracut-module-setup.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 9847d75..4b0852a 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -96,20 +96,16 @@ 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 -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 + # Get bond options specified in ifcfg + . /etc/sysconfig/network-scripts/ifcfg-$_netdev + bondoptions="$(echo :$BONDING_OPTS | sed 's/\s\+/,/')" + echo "$bondoptions" >> ${initdir}/etc/cmdline.d/42bond.conf } kdump_setup_team() {