*** empty log message ***
[openwrt.git] / openwrt / target / default / target_skeleton / 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 # Load sysconf defaults
7 [ -f /etc/sysconf ] && . /etc/sysconf
8
9 # linksys bug; remove when not using static configuration for lan
10 NVRAM_lan_proto="static"
11
12 remap () {
13 for type in lan wifi wan pppoe
14 do
15 for s in '' s
16 do
17 eval NVRAM_${type}_ifname$s=\"$(nvram get ${type}_ifname$s|sed s/$1/$2/g)\"
18 done
19 done
20 }
21
22 # hacks for wrt54g 1.x hardware
23 [ "$(nvram get boardnum)" = "42" ] && \
24 [ "$(nvram get boardtype)" = "bcm94710dev" ] && {
25 debug "### wrt54g 1.x hack ###"
26 NVRAM_vlan1hwname="et0"
27 NVRAM_vlan2hwname="et0"
28 FAILSAFE_ifnames="vlan1 vlan2 eth2"
29 remap eth0 vlan2
30 remap eth1 vlan1
31 }
32
33 # hacks for asus wl-500g deluxe
34 [ "$(nvram get boardtype)" = "bcm95365r" ] && \
35 [ "$(nvram get boardnum)" = "45" ] && {
36 debug "### wl-500g deluxe hacks ###"
37 NVRAM_vlan0hwname="et0"
38 NVRAM_vlan1hwname="et0"
39 FAILSAFE_ifnames="vlan0 vlan1 eth2"
40 remap eth0. vlan
41 }
42
43 # hacks for wap54g hardware
44 [ "$(nvram get boardnum)" = "2" ] || \
45 [ "$(nvram get boardnum)" = "1024" ] && {
46 debug "### wap54g hack ###"
47 NVRAM_wan_ifname="none"
48 FAILSAFE_ifnames="eth0 eth1"
49 }
50
51 # hacks for buffalo wla2-g54l
52 [ "$(nvram get boardnum)" = "00" ] && \
53 [ "$(nvram get product_name)" = "Product_name" ] && {
54 debug "### wla2-g54l hacks ###"
55 NVRAM_wan_ifname="none"
56 NVRAM_lan_ifnames="vlan0"
57 }
58
59 # hack for asus wl-500g hardware
60 [ "$(nvram get boardnum)" = "asusX" ] && \
61 [ "$(nvram get boardtype)" = "bcm94710dev" ] && {
62 FAILSAFE_ifnames="eth0 eth2"
63 }
64
65 # defaults if lan_ifname is missing
66 [ -z "$(nvram get lan_ifname)" ] && {
67 NVRAM_lan_ifname="br0"
68 NVRAM_lan_ifnames=${FAILSAFE_ifnames:-"vlan0 vlan2 eth1 eth2 eth3"}
69 }
70
71 # defaults if wan_ifname is missing
72 [ -z "$(nvram get wan_ifname)" ] && {
73 NVRAM_wan_ifname="vlan1"
74 NVRAM_wan_proto="dhcp"
75 }
76
77 # failsafe if reset is held
78 [ "$FAILSAFE" = "true" ] && {
79 echo "### YOU ARE IN FAILSAFE MODE ####"
80 NVRAM_lan_ifname="br0"
81 NVRAM_lan_ifnames=${FAILSAFE_ifnames:-"vlan0 vlan1 eth1 eth2 eth3"}
82 NVRAM_lan_ipaddr=${BR2_SYSCONF_FAILSAFE_IP:-"192.168.1.1"}
83 NVRAM_lan_netmask=${BR2_SYSCONF_FAILSAFE_NETMASK:-"255.255.255.0"}
84 NVRAM_lan_hwaddr=${BR2_SYSCONF_FAILSAFE_MAC:-"00:0B:AD:0A:DD:00"}
85 NVRAM_wan_ifname="none"
86 NVRAM_wifi_ifname="none"
87 }
This page took 0.043088 seconds and 5 git commands to generate.