2 # Copyright (C) 2010 OpenWrt.org
5 .
/lib
/functions
/octeon.sh
7 platform_do_upgrade
() {
8 local board
=$
(octeon_board_name
)
13 local kernel_length
=`(tar xf $tar_file sysupgrade-erlite/kernel -O | wc -c) 2> /dev/null`
14 local rootfs_length
=`(tar xf $tar_file sysupgrade-erlite/root -O | wc -c) 2> /dev/null`
16 [ -f /boot
/vmlinux
.64 -a ! -L /boot
/vmlinux
.64 ] && {
17 mv /boot
/vmlinux
.64 /boot
/vmlinux
.64.previous
18 mv /boot
/vmlinux
.64.md5
/boot
/vmlinux
.64.md5.previous
22 mount
-t vfat
/dev
/sda1
/boot
23 tar xf
$tar_file sysupgrade-erlite
/kernel
-O > /boot
/vmlinux
.64
24 md5sum /boot
/vmlinux
.64 | cut
-f1 -d " " > /boot
/vmlinux
.64.md5
25 tar xf
$tar_file sysupgrade-erlite
/root
-O |
dd of
=/dev
/sda2 bs
=4096
36 platform_check_image
() {
37 local board
=$
(octeon_board_name
)
42 local kernel_length
=`(tar xf $tar_file sysupgrade-erlite/kernel -O | wc -c) 2> /dev/null`
43 local rootfs_length
=`(tar xf $tar_file sysupgrade-erlite/root -O | wc -c) 2> /dev/null`
44 [ "$kernel_length" = 0 -o "$rootfs_length" = 0 ] && {
45 echo "The upgarde image is corrupt."
52 echo "Sysupgrade is not yet supported on $board."