8591c7de6790b786137d5dc3a1ee11ad4183eef7
[openwrt/openwrt.git] / target / linux / oxnas / base-files / lib / upgrade / platform.sh
1 #
2 # Copyright (C) 2014 OpenWrt.org
3 #
4
5 . /lib/oxnas.sh
6
7 RAMFS_COPY_DATA=/lib/oxnas.sh
8
9 platform_check_image() {
10 local board=$(oxnas_board_name)
11
12 [ "$ARGC" -gt 1 ] && return 1
13
14 nand_do_platform_check $board $1
15 return $?
16 }
17
18 platform_do_upgrade() {
19 if [ $$ -ne 1 ]; then
20 echo "not PID 1, upgrade aborted."
21 return 1;
22 fi
23 platform_do_upgrade_phase2 "$1" "$CONF_TAR" "$SAVE_CONFIG"
24 }
25
26
27 disable_watchdog() {
28 killall watchdog
29 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
30 echo 'Could not disable watchdog'
31 return 1
32 }
33 }
34
35 append sysupgrade_pre_upgrade disable_watchdog