2010-01-03 20:14:17 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2009-2010 OpenWrt.org
|
|
|
|
#
|
|
|
|
|
|
|
|
. /lib/adm5120.sh
|
|
|
|
|
|
|
|
PART_NAME="firmware"
|
|
|
|
RAMFS_COPY_DATA=/lib/adm5120.sh
|
2008-09-25 19:29:04 +08:00
|
|
|
|
|
|
|
platform_check_image() {
|
2010-01-03 20:14:17 +08:00
|
|
|
local magic="$(get_magic_word "$1")"
|
|
|
|
|
2014-06-02 20:43:22 +08:00
|
|
|
[ "$#" -gt 1 ] && return 1
|
2008-09-25 19:29:04 +08:00
|
|
|
|
2010-01-03 20:14:17 +08:00
|
|
|
case "$board_name" in
|
2011-03-22 00:52:14 +08:00
|
|
|
"ZyXEL"*|"Compex WP54 family")
|
2008-09-25 19:29:04 +08:00
|
|
|
# .trx files
|
2010-01-03 20:14:17 +08:00
|
|
|
[ "$magic" != "4844" ] && {
|
|
|
|
echo "Invalid image type."
|
2008-09-25 19:29:04 +08:00
|
|
|
return 1
|
2010-01-03 20:14:17 +08:00
|
|
|
}
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
*)
|
2008-09-25 19:29:04 +08:00
|
|
|
;;
|
|
|
|
esac
|
2010-01-03 20:14:17 +08:00
|
|
|
|
|
|
|
echo "Sysupgrade is not yet supported on $board_name."
|
|
|
|
return 1
|
2008-09-25 19:29:04 +08:00
|
|
|
}
|
|
|
|
|
2010-01-03 20:14:17 +08:00
|
|
|
platform_do_upgrade() {
|
|
|
|
PART_NAME="$sys_mtd_part"
|
|
|
|
default_do_upgrade "$ARGV"
|
|
|
|
}
|
2008-09-25 19:29:04 +08: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
|