2 # Copyright (C) 2016 OpenWrt.org
5 platform_do_upgrade() {
7 local board="$(cat /tmp/sysinfo/board_name)"
10 tar xf $tar_file sysupgrade-$board/kernel -O | mtd write - kernel
12 echo "flashing rootfs"
13 tar xf $tar_file sysupgrade-$board/root -O | mtd write - rootfs
18 platform_check_image() {
20 local board=$(cat /tmp/sysinfo/board_name)
25 local kernel_length=`(tar xf $tar_file sysupgrade-$board/kernel -O | wc -c) 2> /dev/null`
26 local rootfs_length=`(tar xf $tar_file sysupgrade-$board/root -O | wc -c) 2> /dev/null`
30 echo "Sysupgrade is not supported on your board yet."
35 [ "$kernel_length" = 0 -o "$rootfs_length" = 0 ] && {
36 echo "The upgarde image is corrupt."