2 # Copyright (C) 2010 OpenWrt.org
8 RAMFS_COPY_DATA=/lib/ramips.sh
10 platform_check_image() {
11 local board=$(ramips_board_name)
12 local magic="$(get_magic_long "$1")"
14 [ "$#" -gt 1 ] && return 1
91 rt5350f-olinuxino-evb|\
141 [ "$magic" != "27051956" ] && {
142 echo "Invalid image type."
148 [ "$magic" != "6d000080" ] && {
149 echo "Invalid image type."
155 [ "$magic" != "43535953" ] && {
156 echo "Invalid image type."
162 [ "$magic" != "03000000" ] && {
163 echo "Invalid image type."
172 [ "$magic" != "5ea3a417" ] && {
173 echo "Invalid image type."
179 [ "$magic" != "48445230" ] && {
180 echo "Invalid image type."
186 nand_do_platform_check "$board" "$1"
191 echo "Sysupgrade is not yet supported on $board."
195 platform_nand_pre_upgrade() {
196 local board=$(ramips_board_name)
200 platform_upgrade_ubnt_erx "$ARGV"
205 platform_pre_upgrade() {
206 local board=$(ramips_board_name)
210 nand_do_upgrade "$ARGV"
215 platform_do_upgrade() {
216 local board=$(ramips_board_name)
220 default_do_upgrade "$ARGV"
227 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
228 echo 'Could not disable watchdog'
234 . /etc/diag.sh; set_state upgrade
237 append sysupgrade_pre_upgrade disable_watchdog
238 append sysupgrade_pre_upgrade blink_led