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"
19 FAILSAFE_ifnames="vlan1 vlan2 eth2"
22 eval NVRAM_$1=\"$(nvram get $1 | awk 'gsub("eth0","vlan2") gsub("eth1","vlan1")')\"
25 for type in lan wifi wan pppoe
32 # hacks for wap54g hardware
33 [ "$(nvram get boardnum)" = "2" ] || \
34 [ "$(nvram get boardnum)" = "1024" ] && {
35 debug "### wap54g hack ###"
36 NVRAM_wan_ifname="none"
37 FAILSAFE_ifnames="eth0 eth1"
40 # defaults if lan_ifname is missing
41 [ -z "$(nvram get lan_ifname)" ] && {
42 NVRAM_lan_ifname="br0"
43 NVRAM_lan_ifnames="vlan0 vlan2 eth1 eth2 eth3"
46 # defaults if wan_ifname is missing
47 [ -z "$(nvram get wan_ifname)" ] && {
48 NVRAM_wan_ifname="vlan1"
49 NVRAM_wan_proto="dhcp"
52 # failsafe if reset is held
53 [ "$FAILSAFE" = "true" ] && {
54 echo "### YOU ARE IN FAILSAFE MODE ####"
55 NVRAM_lan_ifname="br0"
56 NVRAM_lan_ifnames=${FAILSAFE_ifnames:-"vlan0 vlan1 eth1"}
57 NVRAM_lan_ipaddr="192.168.1.1"
58 NVRAM_lan_netmask="255.255.255.0"
59 NVRAM_lan_hwaddr="00:0B:AD:0A:DD:00"
60 NVRAM_wan_ifname="none"
61 NVRAM_wifi_ifname="none"