summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-06-26 11:43:42 +0000
committerJohn Crispin <john@openwrt.org>2014-06-26 11:43:42 +0000
commit0f39877bacc59049eb0185a93abbcbe23f180bde (patch)
treeb54b10c1f37abbf827ecbca25e8df318d2142dfb /scripts
parentbaa534a8b7331541e6e522ba33b33476e3f67589 (diff)
downloadmtk-20170518-0f39877bacc59049eb0185a93abbcbe23f180bde.zip
mtk-20170518-0f39877bacc59049eb0185a93abbcbe23f180bde.tar.gz
mtk-20170518-0f39877bacc59049eb0185a93abbcbe23f180bde.tar.bz2
scripts/ubinize-image.sh: fix parameter handling
ubinize-image.sh previously used ${var:offset:length} substitutions which are not valid in standard shell. Replace the existing parameter matching by a case ... esac expression. Signed-off-by: Daniel Golle <daniel@makrotopia.org> SVN-Revision: 41347
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ubinize-image.sh51
1 files changed, 27 insertions, 24 deletions
diff --git a/scripts/ubinize-image.sh b/scripts/ubinize-image.sh
index 1058aba..6ffedc5 100755
--- a/scripts/ubinize-image.sh
+++ b/scripts/ubinize-image.sh
@@ -57,36 +57,39 @@ ubilayout() {
}
while [ "$1" ]; do
- if [ "$1" = "--uboot-env" ]; then
+ case "$1" in
+ "--uboot-env")
ubootenv="ubootenv"
shift
continue
- fi
- if [ "$1" = "--no-kernel" ]; then
+ ;;
+ "--no-kernel")
nokernel="nokernel"
shift
continue
- fi
- if [ ! "$kernel" -a ! "$nokernel" ]; then
- [ "${1:0:1}" = "-" ] && break
- kernel=$1
- shift
- continue
- fi
- if [ ! "$rootfs" ]; then
- [ "${1:0:1}" = "-" ] && break
- rootfs=$1
- shift
- continue
- fi
- if [ ! "$outfile" ]; then
- [ "${1:0:1}" = "-" ] && break
- outfile=$1
- shift
- continue
- fi
- ubinize_param="$@"
- break
+ ;;
+ "-"*)
+ ubinize_param="$@"
+ break
+ ;;
+ *)
+ if [ ! "$kernel" -a ! "$nokernel" ]; then
+ kernel=$1
+ shift
+ continue
+ fi
+ if [ ! "$rootfs" ]; then
+ rootfs=$1
+ shift
+ continue
+ fi
+ if [ ! "$outfile" ]; then
+ outfile=$1
+ shift
+ continue
+ fi
+ ;;
+ esac
done
if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$nokernel" -o ! "$outfile" ]; then