From: Felix Fietkau Date: Sun, 15 Jan 2006 16:17:26 +0000 (+0000) Subject: save the boot loader's vlan config before setting the failsafe config and restore... X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;hb=f2fa597e6d7312c85cc212f604c279ffa00f8c16 save the boot loader's vlan config before setting the failsafe config and restore it just before running /sbin/init - necessary for wrt54g v1.1, which doesn't have vlan*ports variables SVN-Revision: 2987 --- diff --git a/openwrt/package/base-files/default/etc/preinit b/openwrt/package/base-files/default/etc/preinit index 575b30ba9c..509f378a88 100755 --- a/openwrt/package/base-files/default/etc/preinit +++ b/openwrt/package/base-files/default/etc/preinit @@ -8,7 +8,12 @@ ifconfig eth0 up 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 } @@ -34,7 +39,15 @@ fi 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