From 828f5da09b0044d0d8fa1d3e40c59b96ec4e2a27 Mon Sep 17 00:00:00 2001 From: Francisco Gil Date: Mon, 17 Jun 2024 10:00:43 +0200 Subject: [PATCH] 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 --- .../u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh | 9 ++++++++- .../u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh | 9 ++++++++- .../u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh | 9 ++++++++- .../u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh | 9 ++++++++- .../u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh | 9 ++++++++- .../u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh | 9 ++++++++- 6 files changed, 48 insertions(+), 6 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh index 17949a556..091be4fa4 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh @@ -90,8 +90,15 @@ echo "############################################################" # -b, -d, -n (booleans) # -i # -u -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 ;; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh index d5e35171e..214fb4e6f 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh @@ -91,8 +91,15 @@ echo "############################################################" # -i # -u # -k -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 ;; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh index f3154a965..4df6795e7 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh @@ -99,8 +99,15 @@ echo "############################################################" # -i # -u # -k -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 ;; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh index 7b3f723d6..9d61627b2 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh @@ -91,8 +91,15 @@ echo "############################################################" # -i # -u # -k -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 ;; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh index b3cfb229d..c49db40a8 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh @@ -91,8 +91,15 @@ echo "############################################################" # -i # -u # -k -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 ;; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh index 8c945f43f..16a9315bd 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh @@ -93,8 +93,15 @@ echo "############################################################" # -i # -u # -k -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 ;;