2015-11-10 00:16:42 +00:00
|
|
|
. /lib/kirkwood.sh
|
|
|
|
|
|
|
|
platform_check_image() {
|
|
|
|
[ "$#" -gt 1 ] && return 1
|
|
|
|
local board="$(kirkwood_board_name)"
|
|
|
|
local magic="$(get_magic_long "$1")"
|
|
|
|
|
|
|
|
case "$board" in
|
|
|
|
"linksys-audi"|\
|
|
|
|
"linksys-viper")
|
|
|
|
[ "$magic" != "27051956" -a "$magic" != "73797375" ] && {
|
|
|
|
echo "Invalid image type."
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
;;
|
2016-12-30 10:55:16 +00:00
|
|
|
*)
|
2016-03-14 17:06:09 +00:00
|
|
|
nand_do_platform_check $board $1
|
|
|
|
return $?
|
|
|
|
;;
|
2015-11-10 00:16:42 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
echo "Sysupgrade is not yet supported on $board."
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
platform_do_upgrade() {
|
|
|
|
local board="$(kirkwood_board_name)"
|
|
|
|
|
|
|
|
case "$board" in
|
|
|
|
"linksys-audi"|\
|
|
|
|
"linksys-viper")
|
|
|
|
platform_do_upgrade_linksys "$ARGV"
|
|
|
|
;;
|
2016-12-30 10:55:16 +00:00
|
|
|
*)
|
|
|
|
default_do_upgrade "$@"
|
|
|
|
;;
|
2015-11-10 00:16:42 +00:00
|
|
|
esac
|
|
|
|
}
|
2016-03-14 17:06:09 +00:00
|
|
|
|
|
|
|
platform_pre_upgrade() {
|
|
|
|
local board=$(kirkwood_board_name)
|
|
|
|
|
|
|
|
case "$board" in
|
2016-12-30 10:55:16 +00:00
|
|
|
"linksys-audi"|\
|
|
|
|
"linksys-viper") ;;
|
|
|
|
*)
|
2016-03-14 17:06:09 +00:00
|
|
|
nand_do_upgrade $1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|