Add profile and userspace for P2812HNUF1/3, switch from UBI_GLUEBI to UBI_BLOCK
[openwrt.git] / target / linux / lantiq / base-files / lib / upgrade / platform.sh
1 . /lib/functions/lantiq.sh
2
3 PART_NAME=firmware
4
5 platform_check_image() {
6         [ "$#" -gt 1 ] && return 1
7         local board=$(lantiq_board_name)
8
9         case "$board" in
10                 BTHOMEHUBV2B|BTHOMEHUBV3A|P2812HNUF* )
11                         nand_do_platform_check $board $1
12                         return $?;
13                         ;;
14         esac
15
16         case "$(get_magic_word "$1")" in
17                 # uImage
18                 2705) return 0;;
19                 # tplink
20                 0200) return 0;;
21                 *)
22                         echo "Invalid image type"
23                         return 1
24                 ;;
25         esac
26 }
27
28 # use default for platform_do_upgrade()
29
30 disable_watchdog() {
31         killall watchdog
32         ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
33                 echo 'Could not disable watchdog'
34                 return 1
35         }
36 }
37 append sysupgrade_pre_upgrade disable_watchdog