insmod switch-core
insmod switch-robo || insmod switch-adm || rmmod switch-core
+# save the boot loader's vlan config
+# we need it on some routers that have no vlan*ports set
[ -d /proc/switch/eth0 ] && {
+ v0p="$(cat /proc/switch/eth0/vlan/0/ports)"
+ v1p="$(cat /proc/switch/eth0/vlan/1/ports)"
+ v2p="$(cat /proc/switch/eth0/vlan/2/ports)"
echo 1 > /proc/switch/eth0/reset
echo "0 1 2 3 4 5u*" > /proc/switch/eth0/vlan/0/ports
}
mount_root ${FAILSAFE:+failsafe}
-# remove the drivers for now, just in case the user has newer versions on the jffs2 partition
+# revert to the boot loader's vlan config
+# required for at least WRT54G v1.1
+[ -d /proc/switch/eth0 ] && {
+ echo "$v0p" > /proc/switch/eth0/vlan/0/ports
+ echo "$v1p" > /proc/switch/eth0/vlan/1/ports
+ echo "$v2p" > /proc/switch/eth0/vlan/2/ports
+}
+
+# remove the drivers for now
rmmod switch-robo
rmmod switch-adm
rmmod switch-core