ramips: Add support for VoCore
[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 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 psr-680w | \
68 px4885 | \
69 rp-n53 | \
70 rt-g32-b1 | \
71 rt-n10-plus | \
72 rt-n14u | \
73 rt-n15 | \
74 rt-n56u | \
75 rut5xx | \
76 sl-r7205 | \
77 tew-691gr | \
78 tew-692gr | \
79 w306r-v20 |\
80 w502u |\
81 wr6202 |\
82 v22rw-2x2 | \
83 vocore | \
84 wl341v3 | \
85 wl-330n | \
86 wl-330n3g | \
87 wl-351 | \
88 wnce2001 | \
89 wli-tx4-ag300n | \
90 whr-g300n |\
91 ur-326n4g |\
92 ur-336un |\
93 wr512-3gn |\
94 wmr300 |\
95 wr8305rt |\
96 wrtnode |\
97 x5 |\
98 x8 |\
99 zbt-wa05)
100 [ "$magic" != "27051956" ] && {
101 echo "Invalid image type."
102 return 1
103 }
104 return 0
105 ;;
106 cy-swr1100 |\
107 dir-610-a1 |\
108 dir-645)
109 [ "$magic" != "5ea3a417" ] && {
110 echo "Invalid image type."
111 return 1
112 }
113 return 0
114 ;;
115 br-6475nd)
116 [ "$magic" != "43535953" ] && {
117 echo "Invalid image type."
118 return 1
119 }
120 return 0
121 ;;
122 esac
123
124 echo "Sysupgrade is not yet supported on $board."
125 return 1
126 }
127
128 platform_do_upgrade() {
129 local board=$(ramips_board_name)
130
131 case "$board" in
132 *)
133 default_do_upgrade "$ARGV"
134 ;;
135 esac
136 }
137
138 disable_watchdog() {
139 killall watchdog
140 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
141 echo 'Could not disable watchdog'
142 return 1
143 }
144 }
145
146 append sysupgrade_pre_upgrade disable_watchdog