mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-26 00:41:17 +00:00
f933a741a9
ARGC is a 'C-ism', but not known/valid in shell-syntax - insert the correct var $# (=number of args) here. under normal conditions this had no impact, but we should at least correct it. the error was observable like this: root@box:~ [ -e "/etc/functions.sh" ] && . /etc/functions.sh root@box:~ [ -e "/lib/functions.sh" ] && . /lib/functions.sh root@box:~ . /lib/upgrade/platform.sh root@box:~ . /lib/upgrade/common.sh root@box:~ platform_check_image /tmp/myfirmware.bin ash: bad number root@box:~ echo $? 0 Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 40915
29 lines
433 B
Bash
Executable File
29 lines
433 B
Bash
Executable File
#
|
|
# 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
|