update-fw scripts: fix error path after sucessful update
On commit 1e5cafeb79 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 <francisco.gilmartinez@digi.com>
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
This commit is contained in:
parent
95be080ab2
commit
fddaee85b9
|
|
@ -86,13 +86,13 @@ 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;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set 'bootcmd' to the second part of the script that will
|
||||
# - Reset environment to defaults
|
||||
|
|
|
|||
|
|
@ -86,13 +86,13 @@ 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;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set 'bootcmd' to the second part of the script that will
|
||||
# - Reset environment to defaults
|
||||
|
|
|
|||
|
|
@ -86,13 +86,13 @@ 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;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set 'bootcmd' to the second part of the script that will
|
||||
# - Reset environment to defaults
|
||||
|
|
|
|||
|
|
@ -86,13 +86,13 @@ 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;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set 'bootcmd' to the second part of the script that will
|
||||
# - Reset environment to defaults
|
||||
|
|
|
|||
|
|
@ -57,13 +57,13 @@ 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;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set 'bootcmd' to the second part of the script that will
|
||||
# - Reset environment to defaults
|
||||
|
|
|
|||
|
|
@ -57,13 +57,13 @@ 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;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set 'bootcmd' to the second part of the script that will
|
||||
# - Reset environment to defaults
|
||||
|
|
|
|||
|
|
@ -128,13 +128,13 @@ 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;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set 'bootcmd' to the second part of the script that will
|
||||
# - Reset environment to defaults
|
||||
|
|
|
|||
|
|
@ -126,13 +126,13 @@ 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;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set 'bootcmd' to the second part of the script that will
|
||||
# - Reset environment to defaults
|
||||
|
|
|
|||
|
|
@ -128,13 +128,13 @@ 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;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set 'bootcmd' to the second part of the script that will
|
||||
# - Reset environment to defaults
|
||||
|
|
|
|||
|
|
@ -128,13 +128,13 @@ 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;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set 'bootcmd' to the second part of the script that will
|
||||
# - Reset environment to defaults
|
||||
|
|
|
|||
Loading…
Reference in New Issue