[kexec-tools] fix and refactor bond handling code
Dave Young
yangrr at fedoraproject.org
Mon Jun 11 06:06:37 UTC 2012
commit 999870558bbe50a2bb088b0d7b8d7eb1a81a4ea7
Author: Cong Wang <amwang at redhat.com>
Date: Sun Jun 10 18:24:35 2012 +0800
fix and refactor bond handling code
This patch fixes dumping over a bonding interface,
we should pass ifname= for all its underlying slaves,
which is required by dracut.
And it separates the code into a different function.
Cc: Vivek Goyal <vgoyal at redhat.com>
Signed-off-by: Cong Wang <amwang at redhat.com>
Acked-by: Dave Young <dyoung at redhat.com>
dracut-module-setup.sh | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index ab9675f..0938121 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -63,6 +63,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_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
+}
+
# Setup dracut to bringup a given network interface
kdump_setup_netdev() {
local _netdev=$1
@@ -81,9 +91,7 @@ kdump_setup_netdev() {
if kdump_is_bridge "$_netdev"; then
kdump_setup_bridge "$_netdev"
elif kdump_is_bond "$_netdev"; then
- echo " bond=$_netdev:\"$(cat /sys/class/net/$_netdev/bonding/slaves)\"" > ${initdir}/etc/cmdline.d/42bond.conf
- #TODO
- #echo "bondoptions=\"$bondoptions\"" >> /tmp/$$-bond
+ kdump_setup_bond "$_netdev"
else
echo -n " ip=${_static}$_netdev:${_proto}" > ${initdir}/etc/cmdline.d/40ip.conf
echo " ifname=$_netdev:$(kdump_get_mac_addr $_netdev)" >> ${initdir}/etc/cmdline.d/40ip.conf
More information about the scm-commits
mailing list