aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/ubinize-image.sh
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-06-26 11:43:42 +0000
committerJohn Crispin <blogic@openwrt.org>2014-06-26 11:43:42 +0000
commite327858613b4d83b5873a372ef669f1f78782a9a (patch)
treef5a6e7a12d07ae3b276c3f403db57042981b22b6 /scripts/ubinize-image.sh
parentd1d6c6e2214103e88765ca04797896b4ab33d001 (diff)
downloadmaster-187ad058-e327858613b4d83b5873a372ef669f1f78782a9a.tar.gz
master-187ad058-e327858613b4d83b5873a372ef669f1f78782a9a.tar.bz2
master-187ad058-e327858613b4d83b5873a372ef669f1f78782a9a.zip
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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41347 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts/ubinize-image.sh')
-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 1058aba812..6ffedc5f32 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