2015-09-04 14:45:00 +00:00
|
|
|
. /lib/ipq806x.sh
|
|
|
|
|
|
|
|
PART_NAME=firmware
|
|
|
|
|
|
|
|
platform_check_image() {
|
|
|
|
local board=$(ipq806x_board_name)
|
|
|
|
|
|
|
|
case "$board" in
|
2016-01-18 10:46:58 +00:00
|
|
|
ap148 |\
|
2016-01-19 10:16:36 +00:00
|
|
|
d7800 |\
|
2016-05-13 06:13:15 +00:00
|
|
|
ea8500 |\
|
2016-10-25 06:40:36 +00:00
|
|
|
nbg6817 |\
|
2016-06-21 09:55:00 +00:00
|
|
|
r7500 |\
|
2016-08-19 20:56:24 +00:00
|
|
|
r7500v2 |\
|
2016-06-21 09:55:00 +00:00
|
|
|
r7800)
|
2015-09-04 14:45:00 +00:00
|
|
|
nand_do_platform_check $board $1
|
|
|
|
return $?;
|
|
|
|
;;
|
2016-05-27 14:26:42 +00:00
|
|
|
c2600)
|
|
|
|
local magic_long="$(get_magic_long "$1")"
|
|
|
|
[ "$magic_long" != "27051956" ] && {
|
|
|
|
echo "Invalid image, bad magic: $magic_long"
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
;;
|
2015-09-04 14:45:00 +00:00
|
|
|
*)
|
|
|
|
return 1;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2015-09-15 16:05:10 +00:00
|
|
|
platform_pre_upgrade() {
|
|
|
|
local board=$(ipq806x_board_name)
|
|
|
|
|
|
|
|
case "$board" in
|
2016-01-18 10:46:58 +00:00
|
|
|
ap148 |\
|
2016-01-19 10:16:36 +00:00
|
|
|
d7800 |\
|
2016-10-25 06:40:36 +00:00
|
|
|
nbg6817 |\
|
2016-06-21 09:55:00 +00:00
|
|
|
r7500 |\
|
2016-08-19 20:56:24 +00:00
|
|
|
r7500v2 |\
|
2016-06-21 09:55:00 +00:00
|
|
|
r7800)
|
2015-09-15 16:05:10 +00:00
|
|
|
nand_do_upgrade "$1"
|
|
|
|
;;
|
2016-05-13 06:13:15 +00:00
|
|
|
ea8500)
|
|
|
|
linksys_preupgrade "$1"
|
|
|
|
;;
|
2015-09-15 16:05:10 +00:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2016-05-27 14:26:42 +00:00
|
|
|
platform_do_upgrade() {
|
|
|
|
local board=$(ipq806x_board_name)
|
|
|
|
|
|
|
|
case "$board" in
|
|
|
|
c2600)
|
|
|
|
PART_NAME="os-image:rootfs"
|
|
|
|
MTD_CONFIG_ARGS="-s 0x200000"
|
|
|
|
default_do_upgrade "$ARGV"
|
|
|
|
;;
|
2016-05-13 06:13:15 +00:00
|
|
|
ea8500)
|
|
|
|
platform_do_upgrade_linksys "$ARGV"
|
|
|
|
;;
|
2016-05-27 14:26:42 +00:00
|
|
|
esac
|
|
|
|
}
|
2016-09-30 19:36:50 +00:00
|
|
|
|
2016-10-25 06:40:36 +00:00
|
|
|
platform_nand_pre_upgrade() {
|
|
|
|
local board=$(ipq806x_board_name)
|
|
|
|
|
|
|
|
case "$board" in
|
|
|
|
nbg6817)
|
|
|
|
zyxel_do_upgrade "$1"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2016-09-30 19:36:50 +00:00
|
|
|
blink_led() {
|
|
|
|
. /etc/diag.sh; set_state upgrade
|
|
|
|
}
|
|
|
|
|
|
|
|
append sysupgrade_pre_upgrade blink_led
|