From 98fe8afd0951e1e4a7b8edb8b5957e8fd1d46758 Mon Sep 17 00:00:00 2001 From: Wiktor Grzywacz Date: Mon, 15 Apr 2024 16:22:36 +0200 Subject: [PATCH 1/2] include/dts-functions.sh fix error handling --- include/dts-functions.sh | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/include/dts-functions.sh b/include/dts-functions.sh index a0463724..2dfa73a8 100644 --- a/include/dts-functions.sh +++ b/include/dts-functions.sh @@ -323,7 +323,8 @@ board_config() { fi ;; *) - error_exit "Board model $SYSTEM_MODEL is currently not supported" + print_error "Board model $SYSTEM_MODEL is currently not supported" + return 1 ;; esac ;; @@ -410,7 +411,8 @@ board_config() { fi ;; *) - error_exit "Board model $BOARD_MODEL is currently not supported" + print_error "Board model $BOARD_MODEL is currently not supported" + return 1 ;; esac ;; @@ -493,12 +495,14 @@ board_config() { fi ;; *) - error_exit "Board model $BOARD_MODEL is currently not supported" + print_error "Board model $BOARD_MODEL is currently not supported" + return 1 ;; esac ;; *) - error_exit "Board model $SYSTEM_MODEL is currently not supported" + print_error "Board model $SYSTEM_MODEL is currently not supported" + return 1 ;; esac ;; @@ -546,10 +550,12 @@ board_config() { # SCH5545_FW="/tmp/_T1650A28.exe.extracted/65C10_output/pfsobject/section-7ec6c2b0-3fe3-42a0-a316-22dd0517c1e8/volume-0x60000/file-d386beb8-4b54-4e69-94f5-06091f67e0d3/section0.raw" # ACM_BIN="/tmp/_T1650A28.exe.extracted/65C10_output/pfsobject/section-7ec6c2b0-3fe3-42a0-a316-22dd0517c1e8/volume-0x500000/file-2d27c618-7dcd-41f5-bb10-21166be7e143/object-0.raw" print_warning "Dasharo Firmware for Precision T1650 not available yet!" - error_exit "Board model $SYSTEM_MODEL is currently not supported" + print_error "Board model $SYSTEM_MODEL is currently not supported" + return 1 ;; *) - error_exit "Board model $SYSTEM_MODEL is currently not supported" + print_error "Board model $SYSTEM_MODEL is currently not supported" + return 1 ;; esac ;; @@ -574,7 +580,8 @@ board_config() { BIOS_LINK_COMM="$FW_STORE_URL/$DASHARO_REL_NAME/v$DASHARO_REL_VER/${DASHARO_REL_NAME}_v${DASHARO_REL_VER}_${FLASH_CHIP_SIZE}M_vboot_notpm.rom" ;; *) - error_exit "Platform uses chipset with not supported size" + print_error "Platform uses chipset with not supported size" + return 1 ;; esac NEED_SMBIOS_MIGRATION="true" @@ -582,7 +589,8 @@ board_config() { PROGRAMMER_BIOS="internal" ;; *) - error_exit "Board model $SYSTEM_MODEL is currently not supported" + print_error "Board model $SYSTEM_MODEL is currently not supported" + return 1 ;; esac ;; @@ -639,13 +647,15 @@ board_config() { NEED_BOOTSPLASH_MIGRATION="true" ;; *) - error_exit "Board model $SYSTEM_MODEL is currently not supported" + print_error "Board model $SYSTEM_MODEL is currently not supported" + return 1 ;; esac shopt -u nocasematch ;; *) - error_exit "Board vendor: $SYSTEM_VENDOR is currently not supported" + print_error "Board vendor: $SYSTEM_VENDOR is currently not supported" + return 1 ;; esac } @@ -703,6 +713,9 @@ check_se_creds() { CLOUDSEND_PASSWORD=$(sed -n '3p' < ${SE_credential_file} | tr -d '\n') USER_DETAILS="$CLOUDSEND_DOWNLOAD_URL:$CLOUDSEND_PASSWORD" board_config + if [ "$?" == "1" ]; then + return 1 + fi TEST_LOGS_URL="https://cloud.3mdeb.com/index.php/s/${CLOUDSEND_LOGS_URL}/authenticate/showShare" if [ ! -v BIOS_LINK_DES ] && [ ! -v HEADS_LINK_DES ]; then From 8b9f6fbb7e90049031a0f5fc883183ea0b6961d6 Mon Sep 17 00:00:00 2001 From: Wiktor Grzywacz Date: Tue, 16 Apr 2024 09:12:40 +0200 Subject: [PATCH 2/2] include: dts-functions: remove unnecessary error_exit --- include/dts-functions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/dts-functions.sh b/include/dts-functions.sh index 2dfa73a8..cf53a95d 100644 --- a/include/dts-functions.sh +++ b/include/dts-functions.sh @@ -719,7 +719,8 @@ check_se_creds() { TEST_LOGS_URL="https://cloud.3mdeb.com/index.php/s/${CLOUDSEND_LOGS_URL}/authenticate/showShare" if [ ! -v BIOS_LINK_DES ] && [ ! -v HEADS_LINK_DES ]; then - error_exit "There is no Dasharo Entry Subscription available for your platform!" + print_error "There is no Dasharo Entry Subscription available for your platform!" + return 1 fi if check_network_connection; then