[package] base-files: add -h and --help options to sysupgrade (#9728)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27630 3c298f89-4303-0410-b956-a3cf2f4a3e73master
parent
4e7f4a35b5
commit
68e0aebc34
|
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=base-files
|
PKG_NAME:=base-files
|
||||||
PKG_RELEASE:=74
|
PKG_RELEASE:=75
|
||||||
|
|
||||||
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
||||||
PKG_BUILD_DEPENDS:=opkg/host
|
PKG_BUILD_DEPENDS:=opkg/host
|
||||||
|
|
|
@ -10,6 +10,7 @@ export SAVE_CONFIG=1
|
||||||
export SAVE_OVERLAY=0
|
export SAVE_OVERLAY=0
|
||||||
export DELAY=
|
export DELAY=
|
||||||
export CONF_IMAGE=
|
export CONF_IMAGE=
|
||||||
|
export HELP=0
|
||||||
|
|
||||||
# parse options
|
# parse options
|
||||||
while [ -n "$1" ]; do
|
while [ -n "$1" ]; do
|
||||||
|
@ -21,6 +22,7 @@ while [ -n "$1" ]; do
|
||||||
-n) export SAVE_CONFIG=0;;
|
-n) export SAVE_CONFIG=0;;
|
||||||
-c) export SAVE_OVERLAY=1;;
|
-c) export SAVE_OVERLAY=1;;
|
||||||
-f) export CONF_IMAGE="$2"; shift;;
|
-f) export CONF_IMAGE="$2"; shift;;
|
||||||
|
-h|--help) export HELP=1; break;;
|
||||||
-*)
|
-*)
|
||||||
echo "Invalid option: $1"
|
echo "Invalid option: $1"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -36,7 +38,7 @@ export CONF_TAR=/tmp/sysupgrade.tgz
|
||||||
export ARGV="$*"
|
export ARGV="$*"
|
||||||
export ARGC="$#"
|
export ARGC="$#"
|
||||||
|
|
||||||
[ -z "$ARGV" ] && {
|
[ -z "$ARGV" -o $HELP -gt 0 ] && {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: $0 [options] <image file or URL>
|
Usage: $0 [options] <image file or URL>
|
||||||
|
|
||||||
|
@ -48,6 +50,7 @@ Options:
|
||||||
-n do not save configuration over reflash
|
-n do not save configuration over reflash
|
||||||
-q less verbose
|
-q less verbose
|
||||||
-v more verbose
|
-v more verbose
|
||||||
|
-h / --help display this help
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue