ralink: DIR610A1 Fix remaining issues
[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 [ "$ARGC" -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 asl26555 | \
27 awm002-evb | \
28 bc2 | \
29 broadway | \
30 carambola | \
31 d105 | \
32 dcs-930 | \
33 dir-300-b1 | \
34 dir-300-b7 | \
35 dir-320-b1 | \
36 dir-600-b1 | \
37 dir-600-b2 | \
38 dir-615-h1 | \
39 dir-615-d | \
40 dir-620-a1 | \
41 dir-620-d1 | \
42 dir-810l | \
43 dap-1350 | \
44 esr-9753 | \
45 f7c027 | \
46 fonera20n | \
47 rt-n13u | \
48 freestation5 | \
49 hw550-3g | \
50 hg255d | \
51 ip2202 | \
52 m3 | \
53 m4 | \
54 mofi3500-3gn | \
55 mpr-a1 | \
56 mpr-a2 | \
57 mzk-w300nh2 | \
58 nbg-419n | \
59 nw718 | \
60 omni-emb | \
61 omni-emb-hpm | \
62 psr-680w | \
63 rp-n53 | \
64 rt-g32-b1 | \
65 rt-n10-plus | \
66 rt-n15 | \
67 rt-n56u | \
68 sl-r7205 | \
69 tew-691gr | \
70 tew-692gr | \
71 w306r-v20 |\
72 w502u |\
73 wr6202 |\
74 v22rw-2x2 | \
75 wl341v3 | \
76 wl-330n | \
77 wl-330n3g | \
78 wl-351 | \
79 wnce2001 | \
80 wli-tx4-ag300n | \
81 whr-g300n |\
82 ur-326n4g |\
83 ur-336un |\
84 wr512-3gn |\
85 x5 |\
86 x8)
87 [ "$magic" != "27051956" ] && {
88 echo "Invalid image type."
89 return 1
90 }
91 return 0
92 ;;
93 dir-610-a1 |\
94 dir-645)
95 [ "$magic" != "5ea3a417" ] && {
96 echo "Invalid image type."
97 return 1
98 }
99 return 0
100 ;;
101 esac
102
103 echo "Sysupgrade is not yet supported on $board."
104 return 1
105 }
106
107 platform_do_upgrade() {
108 local board=$(ramips_board_name)
109
110 case "$board" in
111 *)
112 default_do_upgrade "$ARGV"
113 ;;
114 esac
115 }
116
117 disable_watchdog() {
118 killall watchdog
119 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
120 echo 'Could not disable watchdog'
121 return 1
122 }
123 }
124
125 append sysupgrade_pre_upgrade disable_watchdog