summaryrefslogtreecommitdiffstats
path: root/target/linux/avr32/base-files/lib/upgrade/platform.sh
blob: 403a851c092e17abc6a8ee8c8f59df4599153c4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
# Copyright (C) 2013 OpenWrt.org
#

PART_NAME=firmware

platform_check_image() {
	local magic="$(get_magic_long "$1")"

	[ "$#" -gt 1 ] && return 1

	[ "$magic" != "27051956" ] && {
		echo "Invalid image type."
		return 1
	}

	return 0
}

disable_watchdog() {
	killall watchdog
	( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
		echo 'Could not disable watchdog'
		return 1
	}
}

append sysupgrade_pre_upgrade disable_watchdog