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
111 rt5350f-olinuxino-evb|\
173 [ "$magic" != "27051956" ] && {
174 echo "Invalid image type."
182 [ "$magic" != "43535953" ] && {
183 echo "Invalid image type."
190 [ "$magic" != "6d000080" ] && {
191 echo "Invalid image type."
198 [ "$magic" != "03000000" ] && {
199 echo "Invalid image type."
209 [ "$magic" != "5ea3a417" ] && {
210 echo "Invalid image type."
216 [ "$magic" != "48445230" ] && {
217 echo "Invalid image type."
223 nand_do_platform_check "$board" "$1"
228 echo "Sysupgrade is not yet supported on $board."
232 platform_nand_pre_upgrade() {
233 local board=$(ramips_board_name)
237 platform_upgrade_ubnt_erx "$ARGV"
242 platform_pre_upgrade() {
243 local board=$(ramips_board_name)
247 nand_do_upgrade "$ARGV"
252 platform_do_upgrade() {
253 local board=$(ramips_board_name)
257 default_do_upgrade "$ARGV"
264 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
265 echo 'Could not disable watchdog'
271 . /etc/diag.sh; set_state upgrade
274 append sysupgrade_pre_upgrade disable_watchdog
275 append sysupgrade_pre_upgrade blink_led