From fddaee85b98ed300036cedd729e9530526a3fcf8 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 18 Jan 2021 11:55:28 +0100 Subject: [PATCH] update-fw scripts: fix error path after sucessful update On commit 1e5cafeb7945401794765ef55ccf89f95ba3361c a fall-back update command was introduced in case the newest command fails. If the newest command succeeds, however, the 'test' command for error doesn't match (there is no error) and the return code of such test is "1". On the next check for errors, this results on an error, when we really mean to continue because the first command was successful. Move the second error check inside the error path of the first attempt. Reported-by: Francisco Gil Signed-off-by: Hector Palacios --- .../u-boot-dey/ccimx6ulsbc/install_linux_fw_sd.txt | 12 ++++++------ .../u-boot-dey/ccimx6ulsbc/install_linux_fw_usb.txt | 12 ++++++------ .../ccimx6ulstarter/install_linux_fw_sd.txt | 12 ++++++------ .../ccimx6ulstarter/install_linux_fw_usb.txt | 12 ++++++------ .../u-boot-dey/ccimx8mn-dvk/install_linux_fw_sd.txt | 12 ++++++------ .../u-boot-dey/ccimx8mn-dvk/install_linux_fw_usb.txt | 12 ++++++------ .../ccimx8x-sbc-express/install_linux_fw_sd.txt | 12 ++++++------ .../ccimx8x-sbc-express/install_linux_fw_usb.txt | 12 ++++++------ .../ccimx8x-sbc-pro/install_linux_fw_sd.txt | 12 ++++++------ .../ccimx8x-sbc-pro/install_linux_fw_usb.txt | 12 ++++++------ 10 files changed, 60 insertions(+), 60 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_sd.txt index 91ee9db95..dae64bf27 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_sd.txt @@ -86,12 +86,12 @@ update uboot mmc ${INSTALL_MMCDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument update uboot mmc ${INSTALL_MMCDEV} fat ${INSTALL_UBOOT_FILENAME} -fi -if test $? -eq 1; then - echo "[ERROR] Failed to update U-Boot boot loader!"; - echo ""; - echo "Aborted."; - exit; + if test $? -eq 1; then + echo "[ERROR] Failed to update U-Boot boot loader!"; + echo ""; + echo "Aborted."; + exit; + fi fi # Set 'bootcmd' to the second part of the script that will diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_usb.txt index ad510b9ab..9ed3f9107 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_usb.txt @@ -86,12 +86,12 @@ update uboot usb ${INSTALL_USBDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument update uboot mmc ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} -fi -if test $? -eq 1; then - echo "[ERROR] Failed to update U-Boot boot loader!"; - echo ""; - echo "Aborted."; - exit; + if test $? -eq 1; then + echo "[ERROR] Failed to update U-Boot boot loader!"; + echo ""; + echo "Aborted."; + exit; + fi fi # Set 'bootcmd' to the second part of the script that will diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_sd.txt index 8cee2a0e4..eea78e59b 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_sd.txt @@ -86,12 +86,12 @@ update uboot mmc ${INSTALL_MMCDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument update uboot mmc ${INSTALL_MMCDEV} fat ${INSTALL_UBOOT_FILENAME} -fi -if test $? -eq 1; then - echo "[ERROR] Failed to update U-Boot boot loader!"; - echo ""; - echo "Aborted."; - exit; + if test $? -eq 1; then + echo "[ERROR] Failed to update U-Boot boot loader!"; + echo ""; + echo "Aborted."; + exit; + fi fi # Set 'bootcmd' to the second part of the script that will diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_usb.txt index 23978ea81..86b2a1a2b 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_usb.txt @@ -86,12 +86,12 @@ update uboot usb ${INSTALL_USBDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument update uboot mmc ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} -fi -if test $? -eq 1; then - echo "[ERROR] Failed to update U-Boot boot loader!"; - echo ""; - echo "Aborted."; - exit; + if test $? -eq 1; then + echo "[ERROR] Failed to update U-Boot boot loader!"; + echo ""; + echo "Aborted."; + exit; + fi fi # Set 'bootcmd' to the second part of the script that will diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_sd.txt index 72a9df115..5045af94b 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_sd.txt @@ -57,12 +57,12 @@ update uboot mmc ${INSTALL_MMCDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument update uboot mmc ${INSTALL_MMCDEV} fat ${INSTALL_UBOOT_FILENAME} -fi -if test $? -eq 1; then - echo "[ERROR] Failed to update U-Boot boot loader!"; - echo ""; - echo "Aborted."; - exit; + if test $? -eq 1; then + echo "[ERROR] Failed to update U-Boot boot loader!"; + echo ""; + echo "Aborted."; + exit; + fi fi # Set 'bootcmd' to the second part of the script that will diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_usb.txt index 406e884e5..40ed7a52a 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_usb.txt @@ -57,12 +57,12 @@ update uboot usb ${INSTALL_USBDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument update uboot mmc ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} -fi -if test $? -eq 1; then - echo "[ERROR] Failed to update U-Boot boot loader!"; - echo ""; - echo "Aborted."; - exit; + if test $? -eq 1; then + echo "[ERROR] Failed to update U-Boot boot loader!"; + echo ""; + echo "Aborted."; + exit; + fi fi # Set 'bootcmd' to the second part of the script that will diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_sd.txt index 158ec7d46..3a79ca257 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_sd.txt @@ -128,12 +128,12 @@ update uboot mmc ${INSTALL_MMCDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument update uboot mmc ${INSTALL_MMCDEV} fat ${INSTALL_UBOOT_FILENAME} -fi -if test $? -eq 1; then - echo "[ERROR] Failed to update U-Boot boot loader!"; - echo ""; - echo "Aborted."; - exit; + if test $? -eq 1; then + echo "[ERROR] Failed to update U-Boot boot loader!"; + echo ""; + echo "Aborted."; + exit; + fi fi # Set 'bootcmd' to the second part of the script that will diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_usb.txt index 4f4903cc5..caf034dcd 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_usb.txt @@ -126,12 +126,12 @@ update uboot usb ${INSTALL_USBDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument update uboot mmc ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} -fi -if test $? -eq 1; then - echo "[ERROR] Failed to update U-Boot boot loader!"; - echo ""; - echo "Aborted."; - exit; + if test $? -eq 1; then + echo "[ERROR] Failed to update U-Boot boot loader!"; + echo ""; + echo "Aborted."; + exit; + fi fi # Set 'bootcmd' to the second part of the script that will diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_sd.txt index ea90967d8..6a43e5bb8 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_sd.txt @@ -128,12 +128,12 @@ update uboot mmc ${INSTALL_MMCDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument update uboot mmc ${INSTALL_MMCDEV} fat ${INSTALL_UBOOT_FILENAME} -fi -if test $? -eq 1; then - echo "[ERROR] Failed to update U-Boot boot loader!"; - echo ""; - echo "Aborted."; - exit; + if test $? -eq 1; then + echo "[ERROR] Failed to update U-Boot boot loader!"; + echo ""; + echo "Aborted."; + exit; + fi fi # Set 'bootcmd' to the second part of the script that will diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_usb.txt index 110a9c252..dc297581e 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_usb.txt @@ -128,12 +128,12 @@ update uboot usb ${INSTALL_USBDEV} ${INSTALL_UBOOT_FILENAME} if test $? -eq 1; then # Use old-style update with source file system argument update uboot mmc ${INSTALL_USBDEV} fat ${INSTALL_UBOOT_FILENAME} -fi -if test $? -eq 1; then - echo "[ERROR] Failed to update U-Boot boot loader!"; - echo ""; - echo "Aborted."; - exit; + if test $? -eq 1; then + echo "[ERROR] Failed to update U-Boot boot loader!"; + echo ""; + echo "Aborted."; + exit; + fi fi # Set 'bootcmd' to the second part of the script that will