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
107 rt5350f-olinuxino-evb|\
165 [ "$magic" != "27051956" ] && {
166 echo "Invalid image type."
172 [ "$magic" != "6d000080" ] && {
173 echo "Invalid image type."
179 [ "$magic" != "43535953" ] && {
180 echo "Invalid image type."
187 [ "$magic" != "03000000" ] && {
188 echo "Invalid image type."
197 [ "$magic" != "5ea3a417" ] && {
198 echo "Invalid image type."
204 [ "$magic" != "48445230" ] && {
205 echo "Invalid image type."
211 nand_do_platform_check "$board" "$1"
216 echo "Sysupgrade is not yet supported on $board."
220 platform_nand_pre_upgrade() {
221 local board=$(ramips_board_name)
225 platform_upgrade_ubnt_erx "$ARGV"
230 platform_pre_upgrade() {
231 local board=$(ramips_board_name)
235 nand_do_upgrade "$ARGV"
240 platform_do_upgrade() {
241 local board=$(ramips_board_name)
245 default_do_upgrade "$ARGV"
252 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
253 echo 'Could not disable watchdog'
259 . /etc/diag.sh; set_state upgrade
262 append sysupgrade_pre_upgrade disable_watchdog
263 append sysupgrade_pre_upgrade blink_led