install script: allow -k parameter to be used without arguments

There is a corner case that wasn't cover by the script, if you
use the script using a -k -t the "-t" would be the name of the
dek.bin.

This new implementation solves the issue.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
This commit is contained in:
Francisco Gil 2024-06-17 10:00:43 +02:00
parent d86648f791
commit 828f5da09b
6 changed files with 48 additions and 6 deletions

View File

@ -90,8 +90,15 @@ echo "############################################################"
# -b, -d, -n (booleans)
# -i <image-name>
# -u <u-boot-filename>
while getopts 'bdhi:k:ntu:' c
while getopts ':bdhi:k:ntu:' c
do
if [ "${c}" = ":" ]; then
c="${OPTARG}"
unset OPTARG
elif echo "${OPTARG}" | grep -qs '^-'; then
OPTIND="$((OPTIND-1))"
unset OPTARG
fi
case $c in
b) BOOTCOUNT=true ;;
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;

View File

@ -91,8 +91,15 @@ echo "############################################################"
# -i <image-name>
# -u <u-boot-filename>
# -k <dek-blob-name>
while getopts 'bdhi:k:ntu:' c
while getopts ':bdhi:k:ntu:' c
do
if [ "${c}" = ":" ]; then
c="${OPTARG}"
unset OPTARG
elif echo "${OPTARG}" | grep -qs '^-'; then
OPTIND="$((OPTIND-1))"
unset OPTARG
fi
case $c in
b) BOOTCOUNT=true ;;
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;

View File

@ -99,8 +99,15 @@ echo "############################################################"
# -i <image-name>
# -u <u-boot-filename>
# -k <dek-blob-name>
while getopts 'bdhi:k:ntu:' c
while getopts ':bdhi:k:ntu:' c
do
if [ "${c}" = ":" ]; then
c="${OPTARG}"
unset OPTARG
elif echo "${OPTARG}" | grep -qs '^-'; then
OPTIND="$((OPTIND-1))"
unset OPTARG
fi
case $c in
b) BOOTCOUNT=true ;;
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;

View File

@ -91,8 +91,15 @@ echo "############################################################"
# -i <image-name>
# -u <u-boot-filename>
# -k <dek-blob-name>
while getopts 'bdhi:k:ntu:' c
while getopts ':bdhi:k:ntu:' c
do
if [ "${c}" = ":" ]; then
c="${OPTARG}"
unset OPTARG
elif echo "${OPTARG}" | grep -qs '^-'; then
OPTIND="$((OPTIND-1))"
unset OPTARG
fi
case $c in
b) BOOTCOUNT=true ;;
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;

View File

@ -91,8 +91,15 @@ echo "############################################################"
# -i <image-name>
# -u <u-boot-filename>
# -k <dek-blob-name>
while getopts 'bdhi:k:ntu:' c
while getopts ':bdhi:k:ntu:' c
do
if [ "${c}" = ":" ]; then
c="${OPTARG}"
unset OPTARG
elif echo "${OPTARG}" | grep -qs '^-'; then
OPTIND="$((OPTIND-1))"
unset OPTARG
fi
case $c in
b) BOOTCOUNT=true ;;
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;

View File

@ -93,8 +93,15 @@ echo "############################################################"
# -i <image-name>
# -u <u-boot-filename>
# -k <dek-blob-name>
while getopts 'bdhti:nu:Uk:' c
while getopts ':bdhti:nu:Uk:' c
do
if [ "${c}" = ":" ]; then
c="${OPTARG}"
unset OPTARG
elif echo "${OPTARG}" | grep -qs '^-'; then
OPTIND="$((OPTIND-1))"
unset OPTARG
fi
case $c in
b) BOOTCOUNT=true ;;
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;