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