kirkwood/dockstar: use ubi(kernel, squashfs, ubifs) images
[openwrt.git] / target / linux / kirkwood / base-files / lib / upgrade / platform.sh
1 . /lib/kirkwood.sh
2
3 platform_check_image() {
4         [ "$#" -gt 1 ] && return 1
5         local board="$(kirkwood_board_name)"
6         local magic="$(get_magic_long "$1")"
7
8         case "$board" in
9         "linksys-audi"|\
10         "linksys-viper")
11                 [ "$magic" != "27051956" -a "$magic" != "73797375" ] && {
12                         echo "Invalid image type."
13                         return 1
14                 }
15                 return 0
16                 ;;
17         "dockstar")
18                 nand_do_platform_check $board $1
19                 return $?
20                 ;;
21         esac
22
23         echo "Sysupgrade is not yet supported on $board."
24         return 1
25 }
26
27 platform_do_upgrade() {
28         local board="$(kirkwood_board_name)"
29
30         case "$board" in
31         "linksys-audi"|\
32         "linksys-viper")
33                 platform_do_upgrade_linksys "$ARGV"
34                 ;;
35         esac
36 }
37
38 platform_pre_upgrade() {
39         local board=$(kirkwood_board_name)
40
41         case "$board" in
42         "dockstar")
43                 nand_do_upgrade $1
44                 ;;
45         esac
46 }