treewide: move nand_do_upgrade call to platform_do_upgrade
[openwrt/staging/dedeckeh.git] / target / linux / apm821xx / base-files / lib / upgrade / platform.sh
index 8c716bf44ee8f9173863f060e7e98339628d522c..ced8ce197ae41fe608fa15f94196dc140ab1c2c0 100755 (executable)
@@ -1,51 +1,19 @@
 #!/bin/sh
 
 PART_NAME=firmware
+REQUIRE_IMAGE_METADATA=1
 
 platform_check_image() {
        local board=$(board_name)
 
-       [ "$#" -gt 1 ] && return 1
-
        case "$board" in
-       mbl)
+       wd,mybooklive|\
+       wd,mybooklive-duo)
                mbl_do_platform_check "$1"
                return $?;
                ;;
-
-       mr24|\
-       mx60)
-               merakinand_do_platform_check $board "$1"
-               return $?;
-               ;;
-
-       wndr4700)
-               nand_do_platform_check $board "$1"
-               return $?;
-               ;;
-
-       *)
-               ;;
-       esac
-
-       echo "Sysupgrade is not yet supported on $board."
-       return 1
-}
-
-platform_pre_upgrade() {
-       local board=$(board_name)
-
-       case "$board" in
-       mr24|\
-       mx60)
-               merakinand_do_upgrade "$1"
-               ;;
-
-       wndr4700)
-               nand_do_upgrade "$1"
-               ;;
-
        *)
+               return 0
                ;;
        esac
 }
@@ -54,10 +22,15 @@ platform_do_upgrade() {
        local board=$(board_name)
 
        case "$board" in
-       mbl)
+       wd,mybooklive|\
+       wd,mybooklive-duo)
                mbl_do_upgrade "$ARGV"
                ;;
-
+       meraki,mr24|\
+       meraki,mx60|\
+       netgear,wndr4700)
+               nand_do_upgrade "$1"
+               ;;
        *)
                default_do_upgrade "$ARGV"
                ;;
@@ -68,7 +41,8 @@ platform_copy_config() {
        local board=$(board_name)
 
        case "$board" in
-       mbl)
+       wd,mybooklive|\
+       wd,mybooklive-duo)
                mbl_copy_config
                ;;
 
@@ -76,13 +50,3 @@ platform_copy_config() {
                ;;
        esac
 }
-
-disable_watchdog() {
-       killall watchdog
-       ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
-               echo 'Could not disable watchdog'
-               return 1
-       }
-}
-
-append sysupgrade_pre_upgrade disable_watchdog