3 # This file handles the NVRAM quirks of various hardware.
4 # THIS FILE IS NOT A REPLACEMENT FOR NVRAM
6 # linksys bug; remove when not using static configuration for lan
7 NVRAM_lan_proto="static"
9 # hacks for wrt54g 1.x hardware
10 [ "$(nvram get boardnum)" = "42" ] && \
11 [ "$(nvram get boardtype)" = "bcm94710dev" ] && {
13 # remap eth0 => vlan2, eth1 => vlan1
16 debug "### wrt54g 1.x hack ###"
17 NVRAM_vlan1hwname="et0"
18 NVRAM_vlan2hwname="et0"
21 eval NVRAM_$1=\"$(nvram get $1 | awk 'gsub("eth0","vlan2") gsub("eth1","vlan1")')\"
24 for type in lan wifi wan pppoe
31 # hacks for wap54g hardware
32 [ "$(nvram get boardnum)" = "2" ] || \
33 [ "$(nvram get boardnum)" = "1024" ] && {
34 debug "### wap54g hack ###"
35 NVRAM_wan_ifname="none"
38 # defaults if lan_ifname is missing
39 [ -z "$(nvram get lan_ifname)" ] && {
40 NVRAM_lan_ifname="br0"
41 NVRAM_lan_ifnames="vlan0 vlan2 eth1 eth2 eth3"
44 # defaults if wan_ifname is missing
45 [ -z "$(nvram get wan_ifname)" ] && {
46 NVRAM_wan_ifname="vlan1"
47 NVRAM_wan_proto="dhcp"
50 # failsafe if reset is held
51 [ "$FAILSAFE" = "true" ] && {
52 echo "### YOU ARE IN FAILSAFE MODE ####"
53 NVRAM_lan_ifname="br0"
54 NVRAM_lan_ifnames="vlan0 vlan1 vlan2 eth0 eth1 eth2 eth3"
55 NVRAM_lan_ipaddr="192.168.1.1"
56 NVRAM_lan_netmask="255.255.255.0"
57 NVRAM_lan_hwaddr="00:0B:AD:0A:DD:00"
58 NVRAM_wan_ifname="none"
59 NVRAM_wifi_ifname="none"