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