include all interfaces in failsafe mode
[openwrt.git] / obsolete-buildroot / sources / openwrt / root / etc / nvram.overrides
1 # NVRAM overrides
2 #
3 # This file handles the NVRAM quirks of various hardware.
4 # THIS FILE IS NOT A REPLACEMENT FOR NVRAM
5
6 # linksys bug; remove when not using static configuration for lan
7 NVRAM_lan_proto="static"
8
9 # hacks for wrt54g 1.x hardware
10 [ "$(nvram get boardnum)" = "42" ] && \
11 [ "$(nvram get boardtype)" = "bcm94710dev" ] && {
12
13 # remap eth0 => vlan2, eth1 => vlan1
14 # for all *_ifname(s)
15
16 debug "### wrt54g 1.x hack ###"
17 NVRAM_vlan1hwname="et0"
18 NVRAM_vlan2hwname="et0"
19
20 remap () {
21 eval NVRAM_$1=\"$(nvram get $1 | awk 'gsub("eth0","vlan2") gsub("eth1","vlan1")')\"
22 }
23
24 for type in lan wifi wan pppoe
25 do
26 remap ${type}_ifname
27 remap ${type}_ifnames
28 done
29 }
30
31 # hacks for wap54g hardware
32 [ "$(nvram get boardnum)" = "2" ] || \
33 [ "$(nvram get boardnum)" = "1024" ] && {
34 debug "### wap54g hack ###"
35 NVRAM_wan_ifname="none"
36 }
37
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"
42 }
43
44 # defaults if wan_ifname is missing
45 [ -z "$(nvram get wan_ifname)" ] && {
46 NVRAM_wan_ifname="vlan1"
47 NVRAM_wan_proto="dhcp"
48 }
49
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"
60 }
This page took 0.04075 seconds and 5 git commands to generate.