2004-05-08 15:28:08 +08:00
|
|
|
# NVRAM overrides
|
|
|
|
# This file handles the NVRAM quirks of various hardware
|
2004-07-12 11:37:39 +08:00
|
|
|
# this is not a replacement for nvram.
|
2004-05-08 15:28:08 +08:00
|
|
|
|
|
|
|
# linksys bug has lan doing dhcp; force static
|
|
|
|
lan_proto="static"
|
|
|
|
|
|
|
|
# failsafe if reset is held
|
|
|
|
[ "$FAILSAFE" = "true" ] && {
|
2004-05-10 10:57:59 +08:00
|
|
|
echo "### FAILSAFE MODE ####"
|
2004-05-08 15:28:08 +08:00
|
|
|
lan_ifname="br0"
|
|
|
|
lan_ifnames="vlan0 vlan2 eth1 eth2 eth3"
|
|
|
|
lan_ipaddr="192.168.1.1"
|
|
|
|
lan_netmask="255.255.255.0"
|
|
|
|
lan_hwaddr="00:0B:AD:0A:DD:00"
|
|
|
|
wan_ifname="none"
|
|
|
|
wifi_ifname="none"
|
|
|
|
}
|
|
|
|
|
|
|
|
# hacks for 1.x hardware
|
|
|
|
[ "$(nvram get boardnum)" = "42" ] && \
|
|
|
|
[ "$(nvram get boardtype)" = "bcm94710dev" ] && {
|
|
|
|
debug "### 1.x hardware hack ###"
|
|
|
|
vlan1hwname="et0"
|
|
|
|
vlan2hwname="et0"
|
|
|
|
|
|
|
|
# we remap old device names to new
|
|
|
|
# it's recommended that you continue to
|
|
|
|
# use the old names to preserve backwards
|
|
|
|
# compatibility
|
|
|
|
remap () {
|
|
|
|
eval $1=\"$(nvram_get $1 | awk 'gsub("eth0","vlan2") gsub("eth1","vlan1")')\"
|
|
|
|
}
|
|
|
|
|
|
|
|
remap lan_ifname
|
|
|
|
remap lan_ifnames
|
|
|
|
remap wifi_ifname
|
|
|
|
remap wifi_ifnames
|
|
|
|
remap wan_ifname
|
|
|
|
remap wan_ifnames
|
|
|
|
remap pppoe_ifname
|
|
|
|
}
|
2004-05-10 10:57:59 +08:00
|
|
|
|
|
|
|
[ -z "$(nvram_get lan_ifname)" ] && {
|
|
|
|
lan_ifname="br0"
|
|
|
|
lan_ifnames="vlan0 vlan2 eth1 eth2 eth3"
|
|
|
|
}
|
2004-07-12 07:01:01 +08:00
|
|
|
|
|
|
|
[ -z "$(nvram_get wan_ifname)" ] && {
|
|
|
|
wan_ifname="vlan1"
|
|
|
|
wan_proto="dhcp"
|
|
|
|
}
|