openwrt/target/linux/oxnas/base-files/lib/upgrade/platform.sh
Daniel Golle 69903c3ee6 oxnas: require image metadata
Now that we generate images with metadata attached, require it in order
to prevent accidentally flashing the wrong image to a board.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2017-01-07 14:47:04 +01:00

32 lines
490 B
Bash

#
# Copyright (C) 2014 OpenWrt.org
#
. /lib/oxnas.sh
RAMFS_COPY_DATA=/lib/oxnas.sh
REQUIRE_IMAGE_METADATA=1
platform_check_image() {
local board=$(oxnas_board_name)
[ "$ARGC" -gt 1 ] && return 1
nand_do_platform_check $board $1
return $?
}
platform_pre_upgrade() {
nand_do_upgrade $1
}
disable_watchdog() {
killall watchdog
( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
echo 'Could not disable watchdog'
return 1
}
}
append sysupgrade_pre_upgrade disable_watchdog