00ad863d1bd358b3dfcaadf406dd3a6985bad2e9
[openwrt.git] / target / linux / avr32 / base-files / lib / upgrade / platform.sh
1 #
2 # Copyright (C) 2013 OpenWrt.org
3 #
4
5 PART_NAME=firmware
6
7 platform_check_image() {
8         local magic="$(get_magic_long "$1")"
9
10         [ "$ARGC" -gt 1 ] && return 1
11
12         [ "$magic" != "27051956" ] && {
13                 echo "Invalid image type."
14                 return 1
15         }
16
17         return 0
18 }
19
20 disable_watchdog() {
21         killall watchdog
22         ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
23                 echo 'Could not disable watchdog'
24                 return 1
25         }
26 }
27
28 append sysupgrade_pre_upgrade disable_watchdog