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 |\
|
2015-09-04 14:46:06 +00:00
|
|
|
r7500)
|
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 |\
|
2015-09-15 16:05:10 +00:00
|
|
|
r7500)
|
|
|
|
nand_do_upgrade "$1"
|
|
|
|
;;
|
|
|
|
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"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|