# work around braindead CFE defaults in linksys routers
boardtype=$(nvram get boardtype)
+boardnum=$(nvram get boardnum)
+product_name=$(nvram get product_name)
+
boardflags=$(($(nvram get boardflags)))
-[ "$boardtype" = "bcm94710dev" ] && boardtype="0xdeadbeef"
adm_switch="$(( ($boardflags & 0x80) >> 7 ))"
+
case "$(( $boardtype ))" in
- "$((0x708))")
+ "1800") #0x708
if [ "$adm_switch" = 0 ]; then
nvram_set sdram_init "$(printf 0x%04x $(( $(/usr/sbin/nvram get sdram_init) | 0x0100 )))"
[ "$COMMIT" = 1 ] && {
}
fi
;;
- "$((0x467))")
+ "1127") #0x467
nvram_set sdram_init "$(printf 0x%04x $(( $(/usr/sbin/nvram get sdram_init) | 0x0100 )))"
[ "$COMMIT" = 1 ] && {
nvram_set sdram_config 0x0062
esac
[ "$COMMIT" = "1" ] && nvram commit
-
# linksys bug; remove when not using static configuration for lan
nvram set lan_proto="static"
# hacks for wrt54g 1.x hardware
-[ "$(nvram get boardnum)" = "42" \
--a "$(nvram get boardtype)" = "bcm94710dev" ] && {
+[ "$boardnum" = "42" \
+-a "$boardtype" = "bcm94710dev" ] && {
debug "### wrt54g 1.x hack ###"
nvram set vlan1hwname="et0"
nvram set vlan2hwname="et0"
}
# hacks for asus wl-500g deluxe
-[ "$(nvram get boardtype)" = "bcm95365r" \
--a "$(nvram get boardnum)" = "45" ] && {
+[ "$boardnum" = "45" \
+-a "$boardtype" = "bcm95365r" ] && {
debug "### wl-500g deluxe hacks ###"
nvram set vlan0hwname="et0"
nvram set vlan1hwname="et0"
*)
# wl-500g defaults. these are placed here, because WL-HDD and WL-300g
# might have the same nvram settings.
- [ "$(nvram get boardnum)" = "asusX" \
- -a "$(nvram get boardtype)" = "bcm94710dev" ] && {
+ [ "$boardnum" = "asusX" \
+ -a "$boardtype" = "bcm94710dev" ] && {
nvram_default wan_device "eth1"
}
;;
esac
# hacks for wap54g hardware
-[ "$(nvram get boardnum)" = "2" \
--o "$(nvram get boardnum)" = "1024" ] && {
+[ "$boardnum" = "2" \
+-o "$boardnum" = "1024" ] && {
debug "### wap54g hack ###"
nvram set wan_ifname="none"
}
# hacks for buffalo wla2-g54l
-[ "$(nvram get boardnum)" = "00" \
--a "$(nvram get product_name)" = "Product_name" \
--o "$(nvram get product_name)" = "WLA2-G54L" ] && {
+[ "$boardnum" = "00" \
+-a "$product_name" = "Product_name" \
+-o "$product_name" = "WLA2-G54L" ] && {
debug "### wla2-g54l hacks ###"
nvram set wan_ifname="none"
nvram set lan_ifnames="vlan0"
nvram set il0macaddr=$(nvram get et0macaddr|
awk '{OFS=FS=":";for(x=7,y=2;--x;){$x=sprintf("%02x",(y+="0x"$x)%256);y/=256}print}')
}
-