summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-07-17 09:27:14 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-07-17 09:27:14 +0000
commit1e34c02e3ea774c1818fa17d75095b6efcdc8a02 (patch)
tree7bf3ceed0676ed2ee69bce929491dd1a599a5336 /package
parent53a5beaca89e78028495eaf8320f0b5a5d0edfab (diff)
downloadmtk-20170518-1e34c02e3ea774c1818fa17d75095b6efcdc8a02.zip
mtk-20170518-1e34c02e3ea774c1818fa17d75095b6efcdc8a02.tar.gz
mtk-20170518-1e34c02e3ea774c1818fa17d75095b6efcdc8a02.tar.bz2
base-files: add -h and --help options to sysupgrade (#9728)
SVN-Revision: 27630
Diffstat (limited to 'package')
-rw-r--r--package/base-files/Makefile2
-rwxr-xr-xpackage/base-files/files/sbin/sysupgrade5
2 files changed, 5 insertions, 2 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 75883d8..d537ed3 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=base-files
-PKG_RELEASE:=74
+PKG_RELEASE:=75
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_BUILD_DEPENDS:=opkg/host
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 3d76bb3..7efb2b4 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -10,6 +10,7 @@ export SAVE_CONFIG=1
export SAVE_OVERLAY=0
export DELAY=
export CONF_IMAGE=
+export HELP=0
# parse options
while [ -n "$1" ]; do
@@ -21,6 +22,7 @@ while [ -n "$1" ]; do
-n) export SAVE_CONFIG=0;;
-c) export SAVE_OVERLAY=1;;
-f) export CONF_IMAGE="$2"; shift;;
+ -h|--help) export HELP=1; break;;
-*)
echo "Invalid option: $1"
exit 1
@@ -36,7 +38,7 @@ export CONF_TAR=/tmp/sysupgrade.tgz
export ARGV="$*"
export ARGC="$#"
-[ -z "$ARGV" ] && {
+[ -z "$ARGV" -o $HELP -gt 0 ] && {
cat <<EOF
Usage: $0 [options] <image file or URL>
@@ -48,6 +50,7 @@ Options:
-n do not save configuration over reflash
-q less verbose
-v more verbose
+ -h / --help display this help
EOF
exit 1