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
121 rt5350f-olinuxino-evb|\
189 [ "$magic" != "27051956" ] && {
190 echo "Invalid image type."
198 [ "$magic" != "43535953" ] && {
199 echo "Invalid image type."
206 [ "$magic" != "6d000080" ] && {
207 echo "Invalid image type."
215 [ "$magic" != "03000000" ] && {
216 echo "Invalid image type."
226 [ "$magic" != "5ea3a417" ] && {
227 echo "Invalid image type."
234 # these boards use metadata images
238 nand_do_platform_check "$board" "$1"
243 [ "$magic" != "48445230" ] && {
244 echo "Invalid image type."
251 echo "Sysupgrade is not yet supported on $board."
255 platform_nand_pre_upgrade() {
256 local board=$(ramips_board_name)
260 platform_upgrade_ubnt_erx "$ARGV"
265 platform_pre_upgrade() {
266 local board=$(ramips_board_name)
272 nand_do_upgrade "$ARGV"
277 platform_do_upgrade() {
278 local board=$(ramips_board_name)
282 default_do_upgrade "$ARGV"
289 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
290 echo 'Could not disable watchdog'
296 . /etc/diag.sh; set_state upgrade
299 append sysupgrade_pre_upgrade disable_watchdog
300 append sysupgrade_pre_upgrade blink_led