From 812e5b0afff866ae8d9c2799677ec5c1da7a65c1 Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Mon, 31 Mar 2014 10:35:49 +0200 Subject: 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 --- sysconfig/network-scripts/ifup-eth | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sysconfig/network-scripts/ifup-eth') 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} -- cgit v1.2.1