ramips: rt288x: add support for the Buffalo WLI-TX4-AG300N board
[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         bc2 | \
18         dir-300-b1 | \
19         dir-600-b1 | \
20         dir-600-b2 | \
21         fonera20n | \
22         hw550-3g | \
23         mofi3500-3gn | \
24         nbg-419n | \
25         nw718 | \
26         omni-emb | \
27         rt-g32-b1 | \
28         rt-n15 | \
29         v22rw-2x2 | \
30         wli-tx4-ag300n | \
31         whr-g300n)
32                 [ "$magic" != "2705" ] && {
33                         echo "Invalid image type."
34                         return 1
35                 }
36                 return 0
37                 ;;
38         esac
39
40         echo "Sysupgrade is not yet supported on $board."
41         return 1
42 }
43
44 platform_do_upgrade() {
45         local board=$(ramips_board_name)
46
47         case "$board" in
48         *)
49                 default_do_upgrade "$ARGV"
50                 ;;
51         esac
52 }
53
54 disable_watchdog() {
55         killall watchdog
56         ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
57                 echo 'Could not disable watchdog'
58                 return 1
59         }
60 }
61
62 append sysupgrade_pre_upgrade disable_watchdog