SVN: rc-scripts/trunk: rc.d/init.d/network sysconfig/network-scripts/Makefile.am sysconfig/network-s...

glen glen at pld-linux.org
Tue Jun 5 12:39:28 CEST 2007


Author: glen
Date: Tue Jun  5 12:39:28 2007
New Revision: 8636

Added:
   rc-scripts/trunk/sysconfig/network-scripts/bonddown   (contents, props changed)
   rc-scripts/trunk/sysconfig/network-scripts/bondup   (contents, props changed)
Modified:
   rc-scripts/trunk/rc.d/init.d/network
   rc-scripts/trunk/sysconfig/network-scripts/Makefile.am
Log:
- bonding support by Justas Vilimas


Modified: rc-scripts/trunk/rc.d/init.d/network
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/network	(original)
+++ rc-scripts/trunk/rc.d/init.d/network	Tue Jun  5 12:39:28 2007
@@ -146,7 +146,7 @@
 		interfaces_boot=`
 			for i in $ifcfg_files; do
 				case ${i##*/} in
-					ifcfg-lo|ifcfg-sit*|ifcfg-atm*|ifcfg-lec*|ifcfg-nas*|ifcfg-br*|ifcfg-*.*) continue ;;
+					ifcfg-lo|ifcfg-sit*|ifcfg-atm*|ifcfg-lec*|ifcfg-nas*|ifcfg-br*|ifcfg-bond*|ifcfg-*.*) continue ;;
 				esac
 				ONBOOT=""; . "$i" 2>/dev/null
 				[ ${ONBOOT:-no} = yes ] && echo "${i##*/ifcfg-}"
@@ -185,14 +185,26 @@
 				[ ${ONBOOT:-no} = yes ] && echo "${i##*/ifcfg-}"
 			done
 		`
+
+		interfaces_bond_boot=`
+			for i in $ifcfg_files; do
+				case ${i##*/} in
+					ifcfg-bond*) ;;
+					*) continue ;;
+				esac
+				ONBOOT=""; . "$i" 2>/dev/null
+				[ ${ONBOOT:-no} = yes ] && echo "${i##*/ifcfg-}"
+			done
+		`
+
 	fi
 
-	tunnels=$(
+	tunnels=`
 		for i in $(network_interface_configs 'tnlcfg-*'); do
 			ONBOOT=""; . "$i" 2>/dev/null
 			[ ${ONBOOT:-no} = yes ] && echo "${i##*/tnlcfg-}"
 		done
-	)
+	`
 }
 
 start() {
@@ -203,6 +215,10 @@
 		run_cmd -a "$(nls 'Bringing up interface %s' "$i")" /sbin/ifup $i boot
 	done
 
+	for i in $interfaces_bond_boot; do
+		run_cmd -a "$(nls 'Bringing up bonding interface %s' "$i")" /sbin/bondup $i boot
+	done
+
 	for i in $interfaces_br_boot ; do
 		run_cmd -a "$(nls 'Bringing up bridge interface %s' "$i")" /sbin/ifup $i boot
 	done
@@ -249,6 +265,10 @@
 		run_cmd -a "$(nls 'Shutting down bridge interface %s' "$i")" /sbin/ifdown $i boot
 	done
 
+	for i in $interfaces_bond_boot; do
+		run_cmd -a "$(nls 'Shutting down bonding interface %s' "$i")" /sbin/bonddown $i boot
+	done
+
 	for i in $interfaces_sit_boot $interfaces_vlan_boot $interfaces_boot ; do
 		run_cmd -a "$(nls 'Shutting down interface %s' "$i")" /sbin/ifdown $i boot
 	done

Modified: rc-scripts/trunk/sysconfig/network-scripts/Makefile.am
==============================================================================
--- rc-scripts/trunk/sysconfig/network-scripts/Makefile.am	(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/Makefile.am	Tue Jun  5 12:39:28 2007
@@ -4,7 +4,9 @@
 	ifdown \
 	ifup \
 	tnldown \
-	tnlup
+	tnlup \
+	bonddown \
+	bondup
 
 networkscriptsdir = @networkscriptsdir@
 

Added: rc-scripts/trunk/sysconfig/network-scripts/bonddown
==============================================================================
--- (empty file)
+++ rc-scripts/trunk/sysconfig/network-scripts/bonddown	Tue Jun  5 12:39:28 2007
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+#	bonddown - bonding configuration script (shutdown)
+#	Author: Justas Vilimas <justas at vilimas dot eu> (2007)
+
+. /etc/sysconfig/network
+. /etc/rc.d/init.d/functions
+. /etc/sysconfig/network-scripts/functions.network
+
+DEV=$1
+
+[ -z "$DEV" ] && {
+	nls "Usage: %s <device name>" "bonddown" >&2
+	exit 1
+}
+
+. /etc/sysconfig/interfaces/ifcfg-$DEV
+
+if [ "foo$2" = "fooboot" -a -n "${ONBOOT}" ] && is_no "${ONBOOT}"; then
+	exit
+fi
+
+for slave in $BONDING_SLAVES; do
+	run_cmd -a "$(nls '  Removing slave interface %s' "$slave")" /sbin/ifenslave -d $DEV $slave
+done
+
+/sbin/ifdown $DEV

Added: rc-scripts/trunk/sysconfig/network-scripts/bondup
==============================================================================
--- (empty file)
+++ rc-scripts/trunk/sysconfig/network-scripts/bondup	Tue Jun  5 12:39:28 2007
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+#	bondup - bonding configuration script
+#	Author: Justas Vilimas <justas at vilimas dot eu> (2007)
+
+. /etc/sysconfig/network
+. /etc/rc.d/init.d/functions
+. /etc/sysconfig/network-scripts/functions.network
+
+DEV=$1
+
+[ -z "$DEV" ] && {
+	nls "Usage: %s <device name>" "bondup" >&2
+	exit 1
+}
+
+. /etc/sysconfig/interfaces/ifcfg-$DEV
+
+if [ "foo$2" = "fooboot" -a -n "${ONBOOT}" ] && is_no "${ONBOOT}"; then
+	exit
+fi
+
+/sbin/ifup $DEV
+
+for slave in $BONDING_SLAVES; do
+	run_cmd -a "$(nls '  Adding slave interface %s' "$slave")" /sbin/ifenslave $DEV $slave
+done


More information about the pld-cvs-commit mailing list