ramips: add support for Planex MZK-DP150N
[openwrt/staging/chunkeey.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 dcs-930l-b1 | \
41 dir-300-b1 | \
42 dir-300-b7 | \
43 dir-320-b1 | \
44 dir-600-b1 | \
45 dir-600-b2 | \
46 dir-615-d | \
47 dir-615-h1 | \
48 dir-620-a1 | \
49 dir-620-d1 | \
50 dir-810l | \
51 e1700 | \
52 esr-9753 | \
53 f7c027 | \
54 fonera20n | \
55 freestation5 | \
56 firewrt |\
57 pbr-m1 |\
58 hg255d | \
59 hlk-rm04 | \
60 ht-tm02 | \
61 hw550-3g | \
62 ip2202 | \
63 m2m | \
64 m3 | \
65 m4 | \
66 microwrt | \
67 mlw221 | \
68 mlwg2 | \
69 mofi3500-3gn | \
70 mpr-a1 | \
71 mpr-a2 | \
72 mr-102n | \
73 mzk-w300nh2 | \
74 mzk-dp150n | \
75 nbg-419n | \
76 nw718 | \
77 omni-emb | \
78 omni-emb-hpm | \
79 omni-plug | \
80 olinuxino-rt5350f | \
81 olinuxino-rt5350f-evb | \
82 psr-680w | \
83 px4885 | \
84 re6500 | \
85 rp-n53 | \
86 rt-g32-b1 | \
87 rt-n10-plus | \
88 rt-n13u | \
89 rt-n14u | \
90 rt-n15 | \
91 rt-n56u | \
92 rut5xx | \
93 sl-r7205 | \
94 tew-691gr | \
95 tew-692gr | \
96 ur-326n4g |\
97 ur-336un |\
98 v22rw-2x2 | \
99 vocore | \
100 w150m | \
101 w306r-v20 |\
102 w502u |\
103 whr-g300n |\
104 whr-300hp2 |\
105 whr-600d |\
106 whr-1166d |\
107 wsr-600 |\
108 wl-330n | \
109 wl-330n3g | \
110 wl-351 | \
111 wl341v3 | \
112 wli-tx4-ag300n | \
113 wzr-agl300nh | \
114 wmr300 |\
115 wnce2001 | \
116 wr512-3gn |\
117 wr6202 |\
118 wr8305rt |\
119 wrtnode |\
120 oy-0001 |\
121 wt1520 |\
122 wt3020 |\
123 x5 |\
124 x8 |\
125 xiaomi-miwifi-mini |\
126 y1 |\
127 y1s |\
128 zte-q7 |\
129 zbt-wa05)
130 [ "$magic" != "27051956" ] && {
131 echo "Invalid image type."
132 return 1
133 }
134 return 0
135 ;;
136 wsr-1166)
137 [ "$magic" != "48445230" ] && {
138 echo "Invalid image type."
139 return 1
140 }
141 return 0
142 ;;
143 ar670w)
144 [ "$magic" != "6d000080" ] && {
145 echo "Invalid image type."
146 return 1
147 }
148 return 0
149 ;;
150 cy-swr1100 |\
151 dir-610-a1 |\
152 dir-645 |\
153 dir-860l-b1)
154 [ "$magic" != "5ea3a417" ] && {
155 echo "Invalid image type."
156 return 1
157 }
158 return 0
159 ;;
160 br-6475nd)
161 [ "$magic" != "43535953" ] && {
162 echo "Invalid image type."
163 return 1
164 }
165 return 0
166 ;;
167 c20i)
168 [ "$magic" != "03000000" ] && {
169 echo "Invalid image type."
170 return 1
171 }
172 return 0
173 ;;
174 esac
175
176 echo "Sysupgrade is not yet supported on $board."
177 return 1
178 }
179
180 platform_do_upgrade() {
181 local board=$(ramips_board_name)
182
183 case "$board" in
184 *)
185 default_do_upgrade "$ARGV"
186 ;;
187 esac
188 }
189
190 disable_watchdog() {
191 killall watchdog
192 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
193 echo 'Could not disable watchdog'
194 return 1
195 }
196 }
197
198 append sysupgrade_pre_upgrade disable_watchdog