ramips: add support for Airlink101 AR670W
[openwrt/svn-archive/archive.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 3g300m | \
20 a5-v11 | \
21 air3gii | \
22 all0239-3g | \
23 all0256n | \
24 all5002 | \
25 all5003 | \
26 ar725w | \
27 asl26555 | \
28 awapn2403 | \
29 awm002-evb | \
30 awm003-evb | \
31 bc2 | \
32 broadway | \
33 carambola | \
34 d105 | \
35 dap-1350 | \
36 dcs-930 | \
37 dir-300-b1 | \
38 dir-300-b7 | \
39 dir-320-b1 | \
40 dir-600-b1 | \
41 dir-600-b2 | \
42 dir-615-d | \
43 dir-615-h1 | \
44 dir-620-a1 | \
45 dir-620-d1 | \
46 dir-810l | \
47 esr-9753 | \
48 f7c027 | \
49 fonera20n | \
50 freestation5 | \
51 hg255d | \
52 hlk-rm04 | \
53 ht-tm02 | \
54 hw550-3g | \
55 ip2202 | \
56 m3 | \
57 m4 | \
58 mlw221 | \
59 mofi3500-3gn | \
60 mpr-a1 | \
61 mpr-a2 | \
62 mzk-w300nh2 | \
63 nbg-419n | \
64 nw718 | \
65 omni-emb | \
66 omni-emb-hpm | \
67 omni-plug | \
68 psr-680w | \
69 px4885 | \
70 rp-n53 | \
71 rt-g32-b1 | \
72 rt-n10-plus | \
73 rt-n13u | \
74 rt-n14u | \
75 rt-n15 | \
76 rt-n56u | \
77 rut5xx | \
78 sl-r7205 | \
79 tew-691gr | \
80 tew-692gr | \
81 ur-326n4g |\
82 ur-336un |\
83 v22rw-2x2 | \
84 vocore | \
85 w150m | \
86 w306r-v20 |\
87 w502u |\
88 whr-g300n |\
89 wl-330n | \
90 wl-330n3g | \
91 wl-351 | \
92 wl341v3 | \
93 wli-tx4-ag300n | \
94 wmr300 |\
95 wnce2001 | \
96 wr512-3gn |\
97 wr6202 |\
98 wr8305rt |\
99 wrtnode |\
100 wt1520 |\
101 wt3020 |\
102 x5 |\
103 x8 |\
104 y1 |\
105 y1s |\
106 zbt-wa05)
107 [ "$magic" != "27051956" ] && {
108 echo "Invalid image type."
109 return 1
110 }
111 return 0
112 ;;
113 ar670w)
114 [ "$magic" != "6d000080" ] && {
115 echo "Invalid image type."
116 return 1
117 }
118 return 0
119 ;;
120 cy-swr1100 |\
121 dir-610-a1 |\
122 dir-645)
123 [ "$magic" != "5ea3a417" ] && {
124 echo "Invalid image type."
125 return 1
126 }
127 return 0
128 ;;
129 br-6475nd)
130 [ "$magic" != "43535953" ] && {
131 echo "Invalid image type."
132 return 1
133 }
134 return 0
135 ;;
136 esac
137
138 echo "Sysupgrade is not yet supported on $board."
139 return 1
140 }
141
142 platform_do_upgrade() {
143 local board=$(ramips_board_name)
144
145 case "$board" in
146 *)
147 default_do_upgrade "$ARGV"
148 ;;
149 esac
150 }
151
152 disable_watchdog() {
153 killall watchdog
154 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
155 echo 'Could not disable watchdog'
156 return 1
157 }
158 }
159
160 append sysupgrade_pre_upgrade disable_watchdog