ramips: Adding support for AXIMCom MR-102N 3G/4G Travel Mobile Router
[openwrt/openwrt.git] / target / linux / ramips / base-files / lib / upgrade / platform.sh
1 #
2 # Copyright (C) 2010 OpenWrt.org
3 #
4
5 . /lib/ramips.sh
6
7 PART_NAME=firmware
8 RAMFS_COPY_DATA=/lib/ramips.sh
9
10 platform_check_image() {
11 local board=$(ramips_board_name)
12 local magic="$(get_magic_long "$1")"
13
14 [ "$#" -gt 1 ] && return 1
15
16 case "$board" in
17 3g-6200n | \
18 3g-6200nl | \
19 3g150b | \
20 3g300m | \
21 a5-v11 | \
22 air3gii | \
23 ai-br100 |\
24 all0239-3g | \
25 all0256n | \
26 all5002 | \
27 all5003 | \
28 ar725w | \
29 asl26555 | \
30 awapn2403 | \
31 awm002-evb | \
32 awm003-evb | \
33 bc2 | \
34 broadway | \
35 carambola | \
36 cf-wr800n | \
37 d105 | \
38 dap-1350 | \
39 dcs-930 | \
40 dir-300-b1 | \
41 dir-300-b7 | \
42 dir-320-b1 | \
43 dir-600-b1 | \
44 dir-600-b2 | \
45 dir-615-d | \
46 dir-615-h1 | \
47 dir-620-a1 | \
48 dir-620-d1 | \
49 dir-810l | \
50 e1700 | \
51 esr-9753 | \
52 f7c027 | \
53 fonera20n | \
54 freestation5 | \
55 firewrt |\
56 hg255d | \
57 hlk-rm04 | \
58 ht-tm02 | \
59 hw550-3g | \
60 ip2202 | \
61 m2m | \
62 m3 | \
63 m4 | \
64 microwrt | \
65 mlw221 | \
66 mlwg2 | \
67 mofi3500-3gn | \
68 mpr-a1 | \
69 mpr-a2 | \
70 mr-102n | \
71 mzk-w300nh2 | \
72 nbg-419n | \
73 nw718 | \
74 omni-emb | \
75 omni-emb-hpm | \
76 omni-plug | \
77 psr-680w | \
78 px4885 | \
79 rp-n53 | \
80 rt-g32-b1 | \
81 rt-n10-plus | \
82 rt-n13u | \
83 rt-n14u | \
84 rt-n15 | \
85 rt-n56u | \
86 rut5xx | \
87 sl-r7205 | \
88 tew-691gr | \
89 tew-692gr | \
90 ur-326n4g |\
91 ur-336un |\
92 v22rw-2x2 | \
93 vocore | \
94 w150m | \
95 w306r-v20 |\
96 w502u |\
97 whr-g300n |\
98 whr-600d |\
99 whr-1166d |\
100 wsr-600 |\
101 wl-330n | \
102 wl-330n3g | \
103 wl-351 | \
104 wl341v3 | \
105 wli-tx4-ag300n | \
106 wzr-agl300nh | \
107 wmr300 |\
108 wnce2001 | \
109 wr512-3gn |\
110 wr6202 |\
111 wr8305rt |\
112 wrtnode |\
113 wt1520 |\
114 wt3020 |\
115 x5 |\
116 x8 |\
117 xiaomi-miwifi-mini |\
118 y1 |\
119 y1s |\
120 zte-q7 |\
121 zbt-wa05)
122 [ "$magic" != "27051956" ] && {
123 echo "Invalid image type."
124 return 1
125 }
126 return 0
127 ;;
128 wsr-1166)
129 [ "$magic" != "48445230" ] && {
130 echo "Invalid image type."
131 return 1
132 }
133 return 0
134 ;;
135 ar670w)
136 [ "$magic" != "6d000080" ] && {
137 echo "Invalid image type."
138 return 1
139 }
140 return 0
141 ;;
142 cy-swr1100 |\
143 dir-610-a1 |\
144 dir-645 |\
145 dir-860l-b1)
146 [ "$magic" != "5ea3a417" ] && {
147 echo "Invalid image type."
148 return 1
149 }
150 return 0
151 ;;
152 br-6475nd)
153 [ "$magic" != "43535953" ] && {
154 echo "Invalid image type."
155 return 1
156 }
157 return 0
158 ;;
159 c20i)
160 [ "$magic" != "03000000" ] && {
161 echo "Invalid image type."
162 return 1
163 }
164 return 0
165 ;;
166 esac
167
168 echo "Sysupgrade is not yet supported on $board."
169 return 1
170 }
171
172 platform_do_upgrade() {
173 local board=$(ramips_board_name)
174
175 case "$board" in
176 *)
177 default_do_upgrade "$ARGV"
178 ;;
179 esac
180 }
181
182 disable_watchdog() {
183 killall watchdog
184 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
185 echo 'Could not disable watchdog'
186 return 1
187 }
188 }
189
190 append sysupgrade_pre_upgrade disable_watchdog