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