diff --git a/include/dts-environment.sh b/include/dts-environment.sh index 7e9e929..c430824 100644 --- a/include/dts-environment.sh +++ b/include/dts-environment.sh @@ -80,6 +80,7 @@ RESIGNED_BIOS_UPDATE_FILE="/tmp/biosupdate_resigned.rom" SYSTEM_UUID_FILE="/tmp/system_uuid.txt" SERIAL_NUMBER_FILE="/tmp/serial_number.txt" +LOCAL_FW_BINARIES="/etc/dasharo-nc" # dasharo-deploy backup cmd related variables, do we still use and need this as # backup is placed in HCL? ROOT_DIR="/" diff --git a/include/dts-functions.sh b/include/dts-functions.sh index 10436ab..55a06ec 100644 --- a/include/dts-functions.sh +++ b/include/dts-functions.sh @@ -84,7 +84,6 @@ fum_exit() { if [ "$FUM" == "fum" ]; then print_error "Update cannot be performed" print_warning "Starting bash session" - send_dts_logs ask /bin/bash fi } @@ -228,7 +227,7 @@ board_config() { # We download firmwares via network. At this point, the network connection # must be up already. - wait_for_network_connection + # wait_for_network_connection echo "Checking if board is Dasharo compatible." case "$SYSTEM_VENDOR" in @@ -241,7 +240,7 @@ board_config() { customer-keys/novacustom/dasharo-release-0.9.x-for-novacustom-signing-key.asc" NEED_SMMSTORE_MIGRATION="true" BUCKET_DPP_HEADS="dasharo-novacustom-heads" - + PROGRAMMER_BIOS="internal:boardmismatch=force" case "$SYSTEM_MODEL" in "NV4XMB,ME,MZ") DASHARO_REL_NAME="novacustom_nv4x_tgl" @@ -345,6 +344,7 @@ board_config() { case $BOARD_MODEL in "V540TU") DASHARO_REL_NAME="novacustom_v54x_mtl" + EC_NAME="novacustom_v540tu_ec" FLASHROM_ADD_OPT_UPDATE_OVERRIDE="--ifd -i bios" HAVE_HEADS_FW="true" HEADS_REL_VER_DPP="0.9.0" @@ -353,6 +353,7 @@ board_config() { ;; "V560TU") DASHARO_REL_NAME="novacustom_v56x_mtl" + EC_NAME="novacustom_v560tu_ec" FLASHROM_ADD_OPT_UPDATE_OVERRIDE="--ifd -i bios" HAVE_HEADS_FW="true" HEADS_REL_VER_DPP="0.9.0" @@ -1387,11 +1388,6 @@ show_main_menu() { if [ "${SYSTEM_VENDOR}" != "QEMU" ] && [ "${SYSTEM_VENDOR}" != "Emulation" ]; then echo -e "${BLUE}**${YELLOW} ${REST_FIRM_OPT})${BLUE} Restore firmware from Dasharo HCL report${NORMAL}" fi - if [ -n "${DPP_IS_LOGGED}" ]; then - echo -e "${BLUE}**${YELLOW} ${DPP_KEYS_OPT})${BLUE} Edit your DPP keys${NORMAL}" - else - echo -e "${BLUE}**${YELLOW} ${DPP_KEYS_OPT})${BLUE} Load your DPP keys${NORMAL}" - fi if [ -f "${DPP_SUBMENU_JSON}" ]; then echo -e "${BLUE}**${YELLOW} ${DPP_SUBMENU_OPT})${BLUE} DTS extensions${NORMAL}" fi @@ -1404,25 +1400,14 @@ main_menu_options() { case ${OPTION} in "${HCL_REPORT_OPT}") print_disclaimer - read -p "Do you want to support Dasharo development by sending us logs with your hardware configuration? [N/y] " - case ${REPLY} in - yes | y | Y | Yes | YES) - export SEND_LOGS="true" - echo "Thank you for contributing to the Dasharo development!" - ;; - *) - export SEND_LOGS="false" - echo "Logs will be saved in root directory." - echo "Please consider supporting Dasharo by sending the logs next time." - ;; - esac + export SEND_LOGS="false" if [ "${SEND_LOGS}" == "true" ]; then # DEPLOY_REPORT variable is used in dasharo-hcl-report to determine # which logs should be printed in the terminal, in the future whole # dts scripting should get some LOGLEVEL and maybe dumping working # logs to file export DEPLOY_REPORT="false" - wait_for_network_connection && ${CMD_DASHARO_HCL_REPORT} && LOGS_SENT="1" + wait_for_network_connection && ${CMD_DASHARO_HCL_REPORT} else export DEPLOY_REPORT="false" ${CMD_DASHARO_HCL_REPORT} @@ -1437,26 +1422,10 @@ main_menu_options() { # TODO: this could be handled in a better way: [ "${SYSTEM_VENDOR}" = "QEMU" ] || [ "${SYSTEM_VENDOR}" = "Emulation" ] && return 0 - if wait_for_network_connection; then - echo "Preparing ..." - if [ -z "${LOGS_SENT}" ]; then - export SEND_LOGS="true" - export DEPLOY_REPORT="true" - if ! ${CMD_DASHARO_HCL_REPORT}; then - echo -e "Unable to connect to dl.dasharo.com for submitting the - \rHCL report. Please recheck your internet connection." - else - LOGS_SENT="1" - fi - fi - fi - - if [ -n "${LOGS_SENT}" ]; then - ${CMD_DASHARO_DEPLOY} install - result=$? - if [ "$result" -ne 0 ] && [ "$result" -ne 2 ]; then - send_dts_logs ask && return 0 - fi + ${CMD_DASHARO_DEPLOY} install + result=$? + if [ "$result" -ne 0 ] && [ "$result" -ne 2 ]; then + return 0 fi else # TODO: This should be placed in dasharo-deploy: @@ -1487,7 +1456,7 @@ main_menu_options() { ${CMD_DASHARO_DEPLOY} update result=$? if [ "$result" -ne 0 ] && [ "$result" -ne 2 ]; then - send_dts_logs ask && return 0 + return 0 fi fi read -p "Press Enter to continue." @@ -1501,55 +1470,11 @@ main_menu_options() { if check_if_dasharo; then if ! ${CMD_DASHARO_DEPLOY} restore; then - send_dts_logs ask && return 0 + return 0 fi fi read -p "Press Enter to continue." - return 0 - ;; - "${DPP_KEYS_OPT}") - local _result - # Return if there was an issue when asking for credentials: - if ! get_dpp_creds; then - read -p "Press Enter to continue." - return 0 - fi - - # Try to log in using available DPP credentials, start loop over if login - # was not successful: - if ! login_to_dpp_server; then - echo "Cannot log in to DPP server." - read -p "Press Enter to continue" - return 0 - fi - - # Check for Dasharo Firmware for the current platform, continue to - # packages after checking: - check_for_dasharo_firmware - _result=$? - echo "Your credentials give access to:" - echo -n "Dasharo Pro Package (DPP): " - if [ $_result -eq 0 ]; then - # FIXME: what if credentials have access to - # firmware, but check_for_dasharo_firmware will not detect any platform? - # According to check_for_dasharo_firmware it will return 1 in both - # cases which means that we cannot detect such case. - print_ok "YES" - else - echo "NO" - fi - - echo -n "DTS Extensions: " - - if check_dts_extensions_access; then - print_ok "YES" - check_avail_dpp_packages && install_all_dpp_packages && parse_for_premium_submenu - else - echo "NO" - fi - - read -p "Press Enter to continue." return 0 ;; "${DPP_SUBMENU_OPT}") @@ -1572,18 +1497,6 @@ show_footer() { else echo -ne "${RED}${SSH_OPT_UP}${NORMAL} to launch SSH server ${NORMAL}" fi - if [ "${SEND_LOGS_ACTIVE}" == "true" ]; then - echo -e "${RED}${SEND_LOGS_OPT}${NORMAL} to disable sending DTS logs ${NORMAL}" - else - echo -e "${RED}${SEND_LOGS_OPT}${NORMAL} to enable sending DTS logs ${NORMAL}" - fi - if [ -n "${DPP_IS_LOGGED}" ]; then - if [ "${DISPLAY_CREDENTIALS}" == "true" ]; then - echo -e "${RED}${TOGGLE_DISP_CRED_OPT_UP}${NORMAL} to hide DPP credentials ${NORMAL}" - else - echo -e "${RED}${TOGGLE_DISP_CRED_OPT_UP}${NORMAL} to display DPP credentials ${NORMAL}" - fi - fi echo -ne "${YELLOW}\nEnter an option:${NORMAL}" } @@ -1612,7 +1525,6 @@ footer_options() { clear echo "Entering shell, to leave type exit and press Enter or press LCtrl+D" echo "" - send_dts_logs stop_logging ${CMD_SHELL} start_logging @@ -1622,27 +1534,11 @@ footer_options() { unset DPP_SUBMENU_ACTIVE ;; "${POWEROFF_OPT_UP}" | "${POWEROFF_OPT_LOW}") - send_dts_logs ${POWEROFF} ;; "${REBOOT_OPT_UP}" | "${REBOOT_OPT_LOW}") - send_dts_logs ${REBOOT} ;; - "${SEND_LOGS_OPT}" | "${SEND_LOGS_OPT_LOW}") - if [ "${SEND_LOGS_ACTIVE}" == "true" ]; then - unset SEND_LOGS_ACTIVE - else - export SEND_LOGS_ACTIVE="true" - fi - ;; - "${TOGGLE_DISP_CRED_OPT_UP}" | "${TOGGLE_DISP_CRED_OPT_LOW}") - if [ "${DISPLAY_CREDENTIALS}" == "true" ]; then - unset DISPLAY_CREDENTIALS - else - export DISPLAY_CREDENTIALS="true" - fi - ;; esac return 1 diff --git a/reports/dasharo-hcl-report.sh b/reports/dasharo-hcl-report.sh index 6df5eea..341f4a4 100644 --- a/reports/dasharo-hcl-report.sh +++ b/reports/dasharo-hcl-report.sh @@ -329,81 +329,3 @@ if [ $DEPLOY_REPORT = "false" ]; then echo "Done! Logs saved to: $(readlink -f $filename.tar.gz)" fi -if [ "$SEND_LOGS" = "true" ]; then - if [ $DEPLOY_REPORT = "false" ]; then - echo "Sending logs to 3mdeb MinIO" - fi - - DPP_HCL_BUCKET="dasharo-hcl-reports" - PUBLIC_HCL_BUCKET="dasharo-hcl-reports-public" - - if [ -f "${DPP_CREDENTIAL_FILE}" ]; then - DPP_EMAIL=$(sed -n '1p' <${DPP_CREDENTIAL_FILE} | tr -d '\n') - DPP_PASSWORD=$(sed -n '2p' <${DPP_CREDENTIAL_FILE} | tr -d '\n') - - if [ -z "$DPP_EMAIL" ]; then - echo "DPP e-mail is empty" - exit 1 - fi - if [ -z "$(mc alias list | grep ${DPP_EMAIL})" ]; then - if ! mc alias set $DPP_SERVER_USER_ALIAS $DPP_SERVER_ADDRESS $DPP_EMAIL $DPP_PASSWORD >>$ERR_LOG_FILE 2>&1; then - exit 1 - fi - fi - DPP_HCL_LINK="${DPP_HCL_BUCKET}/${DPP_EMAIL}" - ALIAS=$DPP_SERVER_USER_ALIAS - else - ALIAS="public-hcl" - if [ -z "$(mc alias list | grep ${ALIAS})" ]; then - if ! mc alias set $ALIAS $DPP_SERVER_ADDRESS $BASE_HCL_USERNAME $BASE_HCL_PASSWORD >>$ERR_LOG_FILE 2>&1; then - exit 1 - fi - fi - DPP_HCL_LINK="${PUBLIC_HCL_BUCKET}" - fi - - mc cp "$(readlink -f $filename.tar.gz)" "${ALIAS}/${DPP_HCL_LINK}/" - if [ "$?" -ne "0" ]; then - echo "Failed to send logs to MinIO" - exit 1 - fi - if [ $DEPLOY_REPORT = "false" ]; then - echo "Thank you for supporting Dasharo!" - fi -fi - -echo -e \ - "-----------------------------------------------------------------------------\r -Would you like to contribute to the \"Hardware for Linux\" project?\r -it is an open source project that that anonymously collects hardware details\r -of Linux-powered computers over the world and helps people to collaboratively\r -debug hardware related issues, check for Linux-compatibility and find drivers.\r ------------------------------------------------------------------------------\r -You can find more about it here:\r -https://linux-hardware.org/\r -https://github.com/linuxhw/hw-probe\r ------------------------------------------------------------------------------\r -Do you want to participate in this project?\r -(if you answer \"yes\", then command hw-probe --all --upload will be ran, in \r -order to participate)\r -" - -read -p "[N/y] " -case ${REPLY} in -yes | y | Y | Yes | YES) - $HW_PROBE -all -upload - if [ $? -eq 0 ]; then - echo "Thank you for contributing to the \"Hardware for Linux\" project!" - else - echo "couldn't probe/upload. Check your internet connection..." - exit 1 - fi - ;; -*) - echo -e \ - "Please consider contributing to the \"Hardware for Linux\" project in the future.\r - All you have to do is run this command:\r - hw-probe --all --upload\r - " - ;; -esac diff --git a/scripts/dasharo-deploy.sh b/scripts/dasharo-deploy.sh index 822b19b..5358e8c 100644 --- a/scripts/dasharo-deploy.sh +++ b/scripts/dasharo-deploy.sh @@ -906,7 +906,6 @@ install_workflow() { # 4) Do backup; # 5) Do the installation; # 6) Do some after-installation routine. - sync_clocks # Verify that the device is not using battery as a power source: check_if_ac @@ -945,8 +944,6 @@ install_workflow() { sync echo "Done." - send_dts_logs - if [ "$NEED_EC_RESET" == "true" ]; then echo "The computer will shut down automatically in 5 seconds" else @@ -982,28 +979,29 @@ update_workflow() { # 4) Do the updating; # 5) Do some after-updating routine. CAN_SWITCH_TO_HEADS="false" - sync_clocks # Verify that the device is not using battery as a power source: check_if_ac error_check "Firmware update process interrupted on user request." - # Set all global variables needed for installation: - prepare_env update + if [ "$SYSTEM_MODEL" != "V54x_6x_TU" ]; then + # Set all global variables needed for installation: + prepare_env update - if [ -z "$UPDATE_VERSION" ]; then - error_exit "No update available for your machine" - fi + if [ -z "$UPDATE_VERSION" ]; then + error_exit "No update available for your machine" + fi - print_ok "Current Dasharo version: $DASHARO_VERSION" + print_ok "Current Dasharo version: $DASHARO_VERSION" - if [ "$CAN_SWITCH_TO_HEADS" = "true" ] || [ "$DASHARO_FLAVOR" == "Dasharo (coreboot+heads)" ]; then - print_ok "Latest available Dasharo version for your subscription: $UPDATE_VERSION (coreboot+Heads)" - else - print_ok "Latest available Dasharo version for your subscription: $UPDATE_VERSION" - compare_versions $DASHARO_VERSION $UPDATE_VERSION - if [ $? -ne 1 ]; then - error_exit "No update available for your machine" 2 + if [ "$CAN_SWITCH_TO_HEADS" = "true" ] || [ "$DASHARO_FLAVOR" == "Dasharo (coreboot+heads)" ]; then + print_ok "Latest available Dasharo version for your subscription: $UPDATE_VERSION (coreboot+Heads)" + else + print_ok "Latest available Dasharo version for your subscription: $UPDATE_VERSION" + compare_versions $DASHARO_VERSION $UPDATE_VERSION + if [ $? -ne 1 ]; then + error_exit "No update available for your machine" 2 + fi fi fi @@ -1024,18 +1022,25 @@ update_workflow() { fi fi - if [ "$HAVE_EC" == "true" ]; then - download_ec - verify_artifacts ec - fi + if [ "$SYSTEM_MODEL" == "V54x_6x_TU" ]; then + BIOS_FILE="$LOCAL_FW_BINARIES/${DASHARO_REL_NAME}_v1.0.0.rom" + EC_FILE="$LOCAL_FW_BINARIES/${EC_NAME}.rom" + cp "$BIOS_FILE" "$BIOS_UPDATE_FILE" 2>>"$ERR_LOG_FILE" + cp "$EC_FILE" "$EC_UPDATE_FILE" 2>>"$ERR_LOG_FILE" + else + if [ "$HAVE_EC" == "true" ]; then + download_ec + verify_artifacts ec + fi - download_bios - verify_artifacts bios + download_bios + verify_artifacts bios - # Warning must be displayed after the artifacts have been downloaded, because - # we check their hashes inside display_warning function: - if [ ! "$FUM" == "fum" ]; then - display_warning + # Warning must be displayed after the artifacts have been downloaded, because + # we check their hashes inside display_warning function: + if [ ! "$FUM" == "fum" ]; then + display_warning + fi fi deploy_firmware update @@ -1060,8 +1065,6 @@ update_workflow() { print_ok "Successfully updated Dasharo firmware." fi - send_dts_logs - # Post update routine: if [ "$HAVE_EC" == "true" ]; then deploy_ec_firmware update @@ -1217,9 +1220,9 @@ fi # For FUM we start in dasharo-deploy so we need to verify that we have internet # connection to download shasums in board_config -if [ "$FUM" == "fum" ]; then - wait_for_network_connection -fi +# if [ "$FUM" == "fum" ]; then +# wait_for_network_connection +# fi # flashrom does not support QEMU. TODO: this could be handled in a better way: if [ "${SYSTEM_VENDOR}" != "QEMU" ] && [ "${SYSTEM_VENDOR}" != "Emulation" ]; then @@ -1231,9 +1234,9 @@ fi board_config -if [ -n "$PLATFORM_SIGN_KEY" ]; then - get_signing_keys -fi +# if [ -n "$PLATFORM_SIGN_KEY" ]; then +# get_signing_keys +# fi case "$CMD" in install) diff --git a/scripts/dts.sh b/scripts/dts.sh index 018b5da..ee4271f 100644 --- a/scripts/dts.sh +++ b/scripts/dts.sh @@ -25,9 +25,6 @@ wait_for_input() { while :; do clear - # Do some subscription routine each time menu is rendered: - subscription_routine - # Header should always be printed: show_header if [ -z "$DPP_SUBMENU_ACTIVE" ]; then