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