aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2014-03-31 10:35:49 +0200
committerLukas Nykryn <lnykryn@redhat.com>2014-07-24 13:32:14 +0200
commit812e5b0afff866ae8d9c2799677ec5c1da7a65c1 (patch)
tree227f7fced57e1465d10ba5ddbe7c02f9c6f224a4
parentec25eca54378ecab15c8ba899982cc21ce881353 (diff)
downloadinitscripts-812e5b0afff866ae8d9c2799677ec5c1da7a65c1.tar
initscripts-812e5b0afff866ae8d9c2799677ec5c1da7a65c1.tar.gz
initscripts-812e5b0afff866ae8d9c2799677ec5c1da7a65c1.tar.bz2
initscripts-812e5b0afff866ae8d9c2799677ec5c1da7a65c1.tar.xz
initscripts-812e5b0afff866ae8d9c2799677ec5c1da7a65c1.zip
network: add support for team devices
Currently, team masters and slaves are supported via ifup-Team* and ifdown-Team* scripts shipped in teamd package. It uses somehow ugly workaround where user have to specify DEVIVETYPE to "Team" or "TeamPort". This turned out to be non-optimal solution as this is confusing users. Also it does not work when TYPE is set. So fix this by adding the team support hooks directly into initscripts. Now for team port, user needs only to set: TEAM_MASTER="teamx" and for team master, user needs only to set: TEAM_CONFIG="...whatever..." Signed-off-by: Jiri Pirko <jiri@resnulli.us>
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth8
-rwxr-xr-xsysconfig/network-scripts/ifup-eth12
2 files changed, 20 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index 99eb1a0a..cdf44f56 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -31,6 +31,10 @@ source_config
# Check to make sure the device is actually up
check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a "$BOOTPROTO" != "bootp" ] && [ -n "$VLAN" -a "$VLAN" != "yes" ] && exit 0
+if [ -n "${TEAM_MASTER}" ] && [ ! "${DEVICETYPE}" = "TeamPort" ] && [ -x ./ifdown-TeamPort ]; then
+ ./ifdown-TeamPort ${CONFIG} $2
+fi
+
if [ "${SLAVE}" != "yes" -o -z "${MASTER}" ]; then
if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then
FOUNDMACADDR=$(get_hwaddr ${REALDEVICE})
@@ -140,6 +144,10 @@ if [ "${TYPE}" = "Tap" ]; then
ip tuntap del ${TUNMODE} dev ${DEVICE} >/dev/null
fi
+if [ -n "${TEAM_CONFIG}" ] && [ ! "${DEVICETYPE}" = "Team" ] && [ -x ./ifdown-Team ]; then
+ ./ifdown-Team ${CONFIG} $2
+fi
+
# wait up to 5 seconds for device to actually come down...
waited=0
while ! check_device_down ${DEVICE} && [ "$waited" -lt 50 ] ; do
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index bc0eb962..9d413374 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -72,6 +72,11 @@ if [ "${TYPE}" = "Tap" ]; then
ip tuntap add ${TUNMODE} ${OWNER} dev ${DEVICE} > /dev/null
fi
+# Team master initialization.
+if [ -n "${TEAM_CONFIG}" ] && [ ! "${DEVICETYPE}" = "Team" ] && [ -x ./ifup-Team ]; then
+ ./ifup-Team ${CONFIG} $2
+fi
+
# now check the real state
is_available_wait ${REALDEVICE} ${DEVTIMEOUT} || {
if [ -n "$alias" ]; then
@@ -96,6 +101,13 @@ fi
# is the device wireless? If so, configure wireless device specifics
is_wireless_device ${DEVICE} && . ./ifup-wireless
+# Team slave device?
+if [ -n "${TEAM_MASTER}" ] && [ ! "${DEVICETYPE}" = "TeamPort" ] && [ -x ./ifup-TeamPort ]; then
+ ./ifup-TeamPort ${CONFIG} $2
+ ethtool_set
+ exit 0
+fi
+
# slave device?
if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" ]; then
install_bonding_driver ${MASTER}