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
109 rt5350f-olinuxino-evb|\
171 [ "$magic" != "27051956" ] && {
172 echo "Invalid image type."
178 [ "$magic" != "6d000080" ] && {
179 echo "Invalid image type."
185 [ "$magic" != "43535953" ] && {
186 echo "Invalid image type."
193 [ "$magic" != "03000000" ] && {
194 echo "Invalid image type."
204 [ "$magic" != "5ea3a417" ] && {
205 echo "Invalid image type."
211 [ "$magic" != "48445230" ] && {
212 echo "Invalid image type."
218 nand_do_platform_check "$board" "$1"
223 echo "Sysupgrade is not yet supported on $board."
227 platform_nand_pre_upgrade() {
228 local board=$(ramips_board_name)
232 platform_upgrade_ubnt_erx "$ARGV"
237 platform_pre_upgrade() {
238 local board=$(ramips_board_name)
242 nand_do_upgrade "$ARGV"
247 platform_do_upgrade() {
248 local board=$(ramips_board_name)
252 default_do_upgrade "$ARGV"
259 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
260 echo 'Could not disable watchdog'
266 . /etc/diag.sh; set_state upgrade
269 append sysupgrade_pre_upgrade disable_watchdog
270 append sysupgrade_pre_upgrade blink_led