ramips: rt305x: add support for Edimax 3G-6200N
[openwrt/openwrt.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_word "$1")"
13
14 [ "$ARGC" -gt 1 ] && return 1
15
16 case "$board" in
17 3g-6200n | \
18 all0256n | \
19 bc2 | \
20 dir-300-b1 | \
21 dir-600-b1 | \
22 dir-600-b2 | \
23 esr-9753 | \
24 fonera20n | \
25 freestation5 | \
26 hw550-3g | \
27 mofi3500-3gn | \
28 nbg-419n | \
29 nw718 | \
30 omni-emb | \
31 psr-680w | \
32 rt-g32-b1 | \
33 rt-n10-plus | \
34 rt-n15 | \
35 rt-n56u | \
36 sl-r7205 | \
37 w306r-v20 |\
38 w502u |\
39 wr6202 |\
40 v22rw-2x2 | \
41 wl341v3 | \
42 wl-330n | \
43 wl-351 | \
44 wli-tx4-ag300n | \
45 whr-g300n |\
46 ur-336un |\
47 wr512-3gn)
48 [ "$magic" != "2705" ] && {
49 echo "Invalid image type."
50 return 1
51 }
52 return 0
53 ;;
54 esac
55
56 echo "Sysupgrade is not yet supported on $board."
57 return 1
58 }
59
60 platform_do_upgrade() {
61 local board=$(ramips_board_name)
62
63 case "$board" in
64 *)
65 default_do_upgrade "$ARGV"
66 ;;
67 esac
68 }
69
70 disable_watchdog() {
71 killall watchdog
72 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
73 echo 'Could not disable watchdog'
74 return 1
75 }
76 }
77
78 append sysupgrade_pre_upgrade disable_watchdog