2010-01-03 12:14:17 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2009-2010 OpenWrt.org
|
|
|
|
#
|
|
|
|
|
|
|
|
. /lib/adm5120.sh
|
|
|
|
|
|
|
|
PART_NAME="firmware"
|
|
|
|
RAMFS_COPY_DATA=/lib/adm5120.sh
|
2008-09-25 11:29:04 +00:00
|
|
|
|
|
|
|
platform_check_image() {
|
2010-01-03 12:14:17 +00:00
|
|
|
local magic="$(get_magic_word "$1")"
|
|
|
|
|
2014-06-02 12:43:22 +00:00
|
|
|
[ "$#" -gt 1 ] && return 1
|
2008-09-25 11:29:04 +00:00
|
|
|
|
2010-01-03 12:14:17 +00:00
|
|
|
case "$board_name" in
|
2011-03-21 16:52:14 +00:00
|
|
|
"ZyXEL"*|"Compex WP54 family")
|
2008-09-25 11:29:04 +00:00
|
|
|
# .trx files
|
2010-01-03 12:14:17 +00:00
|
|
|
[ "$magic" != "4844" ] && {
|
|
|
|
echo "Invalid image type."
|
2008-09-25 11:29:04 +00:00
|
|
|
return 1
|
2010-01-03 12:14:17 +00:00
|
|
|
}
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
*)
|
2008-09-25 11:29:04 +00:00
|
|
|
;;
|
|
|
|
esac
|
2010-01-03 12:14:17 +00:00
|
|
|
|
|
|
|
echo "Sysupgrade is not yet supported on $board_name."
|
|
|
|
return 1
|
2008-09-25 11:29:04 +00:00
|
|
|
}
|
|
|
|
|
2010-01-03 12:14:17 +00:00
|
|
|
platform_do_upgrade() {
|
|
|
|
PART_NAME="$sys_mtd_part"
|
|
|
|
default_do_upgrade "$ARGV"
|
|
|
|
}
|
2008-09-25 11:29:04 +00:00
|
|
|
|
|
|
|
disable_watchdog() {
|
|
|
|
killall watchdog
|
|
|
|
( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
|
|
|
|
echo 'Could not disable watchdog'
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
append sysupgrade_pre_upgrade disable_watchdog
|