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