openwrtv4/target/linux/kirkwood/base-files/lib/upgrade/platform.sh
Luka Perkov afa1c47e71 kirkwood/dockstar: use ubi(kernel, squashfs, ubifs) images
The new image requires `bootz` because of devicetree appending.
To flash a new image boot initramfs:

  tftpboot 0x800000 openwrt-kirkwood-dockstar-initramfs-kernel.bin
  bootz 0x800000

  # detach if already attached
  ubidetach -p /dev/$(grep ubi /proc/mtd|awk -F: '{print $1}')
  # scp openwrt-kirkwood-dockstar-squashfs-factory.bin /tmp
  ubiformat -f /tmp/openwrt-kirkwood-dockstar-squashfs-factory.bin
  # attach is important to resize rootfs_data otherwise it wont boot
  ubiattach -p /dev/$(grep ubi /proc/mtd|awk -F: '{print $1}')

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>

SVN-Revision: 49010
2016-03-14 17:06:09 +00:00

46 lines
758 B
Bash

. /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
;;
"dockstar")
nand_do_platform_check $board $1
return $?
;;
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"
;;
esac
}
platform_pre_upgrade() {
local board=$(kirkwood_board_name)
case "$board" in
"dockstar")
nand_do_upgrade $1
;;
esac
}