--- contrib/50-ALTLinux-desktop +++ contrib/50-ALTLinux-desktop @@ -7,3 +7,4 @@ DHCP_CLIENT=/sbin/dhcpcd DHCP_TIMEOUT=30 DHCP_GRACE_TIME=2 DHCP_HOSTNAME=localhost +BRCTL=/sbin/brctl --- contrib/50-ALTLinux-server +++ contrib/50-ALTLinux-server @@ -7,3 +7,4 @@ DHCP_CLIENT=/sbin/dhcpcd DHCP_TIMEOUT=30 DHCP_GRACE_TIME=2 DHCP_HOSTNAME=localhost +BRCTL=/sbin/brctl --- etc/net/scripts/create-bri +++ etc/net/scripts/create-bri @@ -7,13 +7,25 @@ pickup_options is_no "$IFUP_PARENTS" || \ : ${HOST:?HOST must be set for $NAME} -if profiled_filename PROF_BRCTL "$MYIFACEDIR/brctl"; then - print_error "ignoring brctl-style options in $PROF_BRCTL" -fi - $IP link add $NAME type bridge -$IP link set $NAME type bridge $BRIDGE_OPTIONS +$IP link set $NAME type bridge $BRIDGE_OPTIONS ||: + +if profiled_filename_exist PROF_BRCTL "$MYIFACEDIR/brctl"; then + [ -x "${BRCTL:=$DEFAULT_BRCTL}" ] || { + print_error "$PROF_BRCTL options file found, but $BRCTL does not exist or is not executable. Try installing bridge-utils RPM." + exit 1 + } + + $DENOISE $PROF_BRCTL | + trim | + sed "s/ AUTO / $NAME /" | + xargs --max-lines=1 --no-run-if-empty $BRCTL -for host in $HOST; do - $IP link set $host master $NAME && print_progress -done + for host in $HOST; do + $BRCTL addif $NAME $host + done +else + for host in $HOST; do + $IP link set $host master $NAME ||: + done +fi && print_progress --- etc/net/scripts/functions +++ etc/net/scripts/functions @@ -23,6 +23,7 @@ DEFAULT_WPA_CLI=/usr/sbin/wpa_cli DEFAULT_PLIPCONFIG=/sbin/plipconfig DEFAULT_VCONFIG=/usr/bin/vconfig DEFAULT_IPSECADM=/usr/sbin/ipsecadm +DEFAULT_BRCTL=/usr/sbin/brctl DEFAULT_ETHTOOL=/usr/sbin/ethtool DEFAULT_RESOLVCONFTOOL=/sbin/resolvconf DEFAULT_PPPD=/usr/sbin/pppd diff --git a/etc/net/scripts/shutdown-bri b/etc/net/scripts/shutdown-bri index f6823b6..cb6df44 100755 --- etc/net/scripts/shutdown-bri +++ etc/net/scripts/shutdown-bri @@ -5,5 +5,5 @@ init_netprofile pickup_options for host in $HOST; do - $IP link set $host nomaster + $IP link set $host nomaster ||: done