then its values should be separated by semicolon.
Bond without parameters assumes bond=bond0:eth0,eth1:mode=balance-rr
+**team =_<teammaster>_:_<teamslaves>_**::
+ Setup team device <teammaster> on top of <teamslaves>.
+ <teamslaves> is a comma-separated list of physical (ethernet) interfaces.
+
**bridge=_<bridgename>_:_<ethnames>_**::
Setup bridge <bridgename> with <ethnames>. <ethnames> is a comma-separated
list of physical (ethernet) interfaces. Bridge without parameters assumes bridge=br0:eth0
done
fi
+if [ -e /tmp/team.info ]; then
+ . /tmp/team.info
+ for slave in $teamslaves ; do
+ if [ "$netif" = "$slave" ] ; then
+ netif=$teammaster
+ fi
+ done
+fi
+
# bridge this interface?
if [ -e /tmp/bridge.info ]; then
. /tmp/bridge.info
fi
fi
+if [ -e /tmp/team.info ]; then
+ . /tmp/team.info
+ if [ "$netif" = "$teammaster" ] && [ ! -e /tmp/net.$teammaster.up ] ; then
+ # We shall only bring up those _can_ come up
+ # in case of some slave is gone in active-backup mode
+ working_slaves=""
+ for slave in $teamslaves ; do
+ ip link set $slave up 2>/dev/null
+ if wait_for_if_up $slave; then
+ working_slaves+="$slave "
+ fi
+ done
+ # Do not add slaves now
+ teamd -d -U -n -f /etc/teamd/$teammaster.conf
+ for slave in $working_slaves; do
+ # team requires the slaves to be down before joining team
+ ip link set $slave down
+ teamdctl $teammaster port add $slave
+ done
+ ip link set $teammaster up
+ fi
+fi
# XXX need error handling like dhclient-script
{ find_kernel_modules_by_path drivers/net; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/net; fi; } \
| net_module_filter | instmods
- instmods =drivers/net/phy ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net
+ #instmods() will take care of hostonly
+ instmods =drivers/net/phy ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net =drivers/net/team
}
install() {
dracut_install ip arping dhclient sed
dracut_install -o ping ping6
dracut_install -o brctl
+ dracut_install -o teamd teamdctl teamnl
+ inst_simple /etc/libnl/classid
inst_script "$moddir/ifup.sh" "/sbin/ifup"
inst_script "$moddir/netroot.sh" "/sbin/netroot"
inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
inst_hook cmdline 95 "$moddir/parse-vlan.sh"
inst_hook cmdline 96 "$moddir/parse-bond.sh"
+ inst_hook cmdline 96 "$moddir/parse-team.sh"
inst_hook cmdline 97 "$moddir/parse-bridge.sh"
inst_hook cmdline 98 "$moddir/parse-ip-opts.sh"
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
IFACES+=" ${bondslaves%% *}"
fi
+ if [ -e /tmp/team.info ]; then
+ . /tmp/team.info
+ IFACES+=" ${teamslaves}"
+ fi
+
if [ -e /tmp/vlan.info ]; then
. /tmp/vlan.info
IFACES+=" $phydevice"
--- /dev/null
+#!/bin/sh
+#
+# Format:
+# team=<teammaster>:<teamslaves>
+#
+# teamslaves is a comma-separated list of physical (ethernet) interfaces
+#
+
+# return if team already parsed
+[ -n "$teammaster" ] && return
+
+# Check if team parameter is valid
+if getarg team= >/dev/null ; then
+ :
+fi
+
+parseteam() {
+ local v=${1}:
+ set --
+ while [ -n "$v" ]; do
+ set -- "$@" "${v%%:*}"
+ v=${v#*:}
+ done
+
+ unset teammaster teamslaves
+ case $# in
+ 2) teammaster=$1; teamslaves=$(str_replace "$2" "," " ") ;;
+ *) die "team= requires two parameters" ;;
+ esac
+}
+
+unset teammaster teamslaves
+
+if getarg team>/dev/null; then
+ # Read team= parameters if they exist
+ team="$(getarg team=)"
+ if [ ! "$team" = "team" ]; then
+ parseteam "$(getarg team=)"
+ fi
+
+ echo "teammaster=$teammaster" > /tmp/team.info
+ echo "teamslaves=\"$teamslaves\"" >> /tmp/team.info
+ return
+fi