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
v19.07.3_mercusys_ac12_duma
John Crispin 10 years ago
parent baa534a8b7
commit 0f39877bac

@ -57,36 +57,39 @@ ubilayout() {
} }
while [ "$1" ]; do while [ "$1" ]; do
if [ "$1" = "--uboot-env" ]; then case "$1" in
"--uboot-env")
ubootenv="ubootenv" ubootenv="ubootenv"
shift shift
continue continue
fi ;;
if [ "$1" = "--no-kernel" ]; then "--no-kernel")
nokernel="nokernel" nokernel="nokernel"
shift shift
continue continue
fi ;;
if [ ! "$kernel" -a ! "$nokernel" ]; then "-"*)
[ "${1:0:1}" = "-" ] && break ubinize_param="$@"
kernel=$1 break
shift ;;
continue *)
fi if [ ! "$kernel" -a ! "$nokernel" ]; then
if [ ! "$rootfs" ]; then kernel=$1
[ "${1:0:1}" = "-" ] && break shift
rootfs=$1 continue
shift fi
continue if [ ! "$rootfs" ]; then
fi rootfs=$1
if [ ! "$outfile" ]; then shift
[ "${1:0:1}" = "-" ] && break continue
outfile=$1 fi
shift if [ ! "$outfile" ]; then
continue outfile=$1
fi shift
ubinize_param="$@" continue
break fi
;;
esac
done done
if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$nokernel" -o ! "$outfile" ]; then if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$nokernel" -o ! "$outfile" ]; then

Loading…
Cancel
Save