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:
parent
d86648f791
commit
828f5da09b
|
|
@ -90,8 +90,15 @@ echo "############################################################"
|
||||||
# -b, -d, -n (booleans)
|
# -b, -d, -n (booleans)
|
||||||
# -i <image-name>
|
# -i <image-name>
|
||||||
# -u <u-boot-filename>
|
# -u <u-boot-filename>
|
||||||
while getopts 'bdhi:k:ntu:' c
|
while getopts ':bdhi:k:ntu:' c
|
||||||
do
|
do
|
||||||
|
if [ "${c}" = ":" ]; then
|
||||||
|
c="${OPTARG}"
|
||||||
|
unset OPTARG
|
||||||
|
elif echo "${OPTARG}" | grep -qs '^-'; then
|
||||||
|
OPTIND="$((OPTIND-1))"
|
||||||
|
unset OPTARG
|
||||||
|
fi
|
||||||
case $c in
|
case $c in
|
||||||
b) BOOTCOUNT=true ;;
|
b) BOOTCOUNT=true ;;
|
||||||
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,15 @@ echo "############################################################"
|
||||||
# -i <image-name>
|
# -i <image-name>
|
||||||
# -u <u-boot-filename>
|
# -u <u-boot-filename>
|
||||||
# -k <dek-blob-name>
|
# -k <dek-blob-name>
|
||||||
while getopts 'bdhi:k:ntu:' c
|
while getopts ':bdhi:k:ntu:' c
|
||||||
do
|
do
|
||||||
|
if [ "${c}" = ":" ]; then
|
||||||
|
c="${OPTARG}"
|
||||||
|
unset OPTARG
|
||||||
|
elif echo "${OPTARG}" | grep -qs '^-'; then
|
||||||
|
OPTIND="$((OPTIND-1))"
|
||||||
|
unset OPTARG
|
||||||
|
fi
|
||||||
case $c in
|
case $c in
|
||||||
b) BOOTCOUNT=true ;;
|
b) BOOTCOUNT=true ;;
|
||||||
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
||||||
|
|
|
||||||
|
|
@ -99,8 +99,15 @@ echo "############################################################"
|
||||||
# -i <image-name>
|
# -i <image-name>
|
||||||
# -u <u-boot-filename>
|
# -u <u-boot-filename>
|
||||||
# -k <dek-blob-name>
|
# -k <dek-blob-name>
|
||||||
while getopts 'bdhi:k:ntu:' c
|
while getopts ':bdhi:k:ntu:' c
|
||||||
do
|
do
|
||||||
|
if [ "${c}" = ":" ]; then
|
||||||
|
c="${OPTARG}"
|
||||||
|
unset OPTARG
|
||||||
|
elif echo "${OPTARG}" | grep -qs '^-'; then
|
||||||
|
OPTIND="$((OPTIND-1))"
|
||||||
|
unset OPTARG
|
||||||
|
fi
|
||||||
case $c in
|
case $c in
|
||||||
b) BOOTCOUNT=true ;;
|
b) BOOTCOUNT=true ;;
|
||||||
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,15 @@ echo "############################################################"
|
||||||
# -i <image-name>
|
# -i <image-name>
|
||||||
# -u <u-boot-filename>
|
# -u <u-boot-filename>
|
||||||
# -k <dek-blob-name>
|
# -k <dek-blob-name>
|
||||||
while getopts 'bdhi:k:ntu:' c
|
while getopts ':bdhi:k:ntu:' c
|
||||||
do
|
do
|
||||||
|
if [ "${c}" = ":" ]; then
|
||||||
|
c="${OPTARG}"
|
||||||
|
unset OPTARG
|
||||||
|
elif echo "${OPTARG}" | grep -qs '^-'; then
|
||||||
|
OPTIND="$((OPTIND-1))"
|
||||||
|
unset OPTARG
|
||||||
|
fi
|
||||||
case $c in
|
case $c in
|
||||||
b) BOOTCOUNT=true ;;
|
b) BOOTCOUNT=true ;;
|
||||||
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,15 @@ echo "############################################################"
|
||||||
# -i <image-name>
|
# -i <image-name>
|
||||||
# -u <u-boot-filename>
|
# -u <u-boot-filename>
|
||||||
# -k <dek-blob-name>
|
# -k <dek-blob-name>
|
||||||
while getopts 'bdhi:k:ntu:' c
|
while getopts ':bdhi:k:ntu:' c
|
||||||
do
|
do
|
||||||
|
if [ "${c}" = ":" ]; then
|
||||||
|
c="${OPTARG}"
|
||||||
|
unset OPTARG
|
||||||
|
elif echo "${OPTARG}" | grep -qs '^-'; then
|
||||||
|
OPTIND="$((OPTIND-1))"
|
||||||
|
unset OPTARG
|
||||||
|
fi
|
||||||
case $c in
|
case $c in
|
||||||
b) BOOTCOUNT=true ;;
|
b) BOOTCOUNT=true ;;
|
||||||
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
||||||
|
|
|
||||||
|
|
@ -93,8 +93,15 @@ echo "############################################################"
|
||||||
# -i <image-name>
|
# -i <image-name>
|
||||||
# -u <u-boot-filename>
|
# -u <u-boot-filename>
|
||||||
# -k <dek-blob-name>
|
# -k <dek-blob-name>
|
||||||
while getopts 'bdhti:nu:Uk:' c
|
while getopts ':bdhti:nu:Uk:' c
|
||||||
do
|
do
|
||||||
|
if [ "${c}" = ":" ]; then
|
||||||
|
c="${OPTARG}"
|
||||||
|
unset OPTARG
|
||||||
|
elif echo "${OPTARG}" | grep -qs '^-'; then
|
||||||
|
OPTIND="$((OPTIND-1))"
|
||||||
|
unset OPTARG
|
||||||
|
fi
|
||||||
case $c in
|
case $c in
|
||||||
b) BOOTCOUNT=true ;;
|
b) BOOTCOUNT=true ;;
|
||||||
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
d) INSTALL_DUALBOOT=true && BOOTCOUNT=true ;;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue