summaryrefslogtreecommitdiffstats
path: root/openwrt/package/base-files/default/etc
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-01-04 20:08:27 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-01-04 20:08:27 +0000
commitad37d55186f7e517c58f47b5d464b813ba8746f0 (patch)
tree360d52d4f90ecfe8295f8e6fabd399128f93a40c /openwrt/package/base-files/default/etc
parentbcb8695c57f8bd7bccd86e35e61a29a9a6896b16 (diff)
configure switch at boot time based on vlan*ports
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@2822 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/package/base-files/default/etc')
-rw-r--r--openwrt/package/base-files/default/etc/hotplug.d/net/10-net10
1 files changed, 9 insertions, 1 deletions
diff --git a/openwrt/package/base-files/default/etc/hotplug.d/net/10-net b/openwrt/package/base-files/default/etc/hotplug.d/net/10-net
index 0417b397f..fb7b128ea 100644
--- a/openwrt/package/base-files/default/etc/hotplug.d/net/10-net
+++ b/openwrt/package/base-files/default/etc/hotplug.d/net/10-net
@@ -7,11 +7,19 @@ setup_eth()
iwconfig "$INTERFACE" 2>&- | grep -v 'no wireless' >&- && {
/sbin/wifi
}
+ [ -d /proc/switch ] || {
+ insmod switch-core
+ insmod switch-robo || insmod switch-adm
+ }
if="$(echo "$INTERFACE" | sed s,eth,et,)"
ifconfig "$INTERFACE" up 2>&- >&-
for vlan in $(seq 0 15); do
- [ "$(nvram get vlan${vlan}hwname)" = "$if" ] && \
+ [ "$(nvram get vlan${vlan}hwname)" = "$if" ] && {
$DEBUG vconfig add "$INTERFACE" "$vlan"
+ vports="$(nvram get vlan${vlan}ports)"
+ [ \! -z "$vports" -a -d "/proc/switch/$INTERFACE" ] && \
+ echo "$vports" > "/proc/switch/$INTERFACE/vlan/$vlan/ports"
+ }
done
}