Skip to content

install_workflow: Exit when trying to flash v1.1.1 on 13th gen and above #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions scripts/dasharo-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,23 @@ install_workflow() {
download_bios
verify_artifacts bios
fi

# TODO: It is not a good practice to do some target specific work in the code
# of a scallable product, this should be handled in a more scallable way:
Comment on lines +921 to +922
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe

do_nothing() {
    :
}

min_intel_cpu_gen() {
    local min_gen=$1
    local workflow=$2
    if [ "$(get_intel_gen)" -lt "$min_gen" ]; then
        return 1;
    else
        return 0;
    fi
}

# use: '$PRE_DEPLOY_CHECK <deploy_workflow>'
PRE_DEPLOY_CHECK=do_nothing
(...)
case "$SYSTEM_MODEL" in
        "MS-7D25")
            PRE_DEPLOY_CHECK="min_intel_cpu_gen 11"
            (...)

(...)
install() {
    $PRE_DEPLOY_CHECK install
}

That way we could create different checks for different platforms if needed

if [[ "$UPDATE_VERSION" == "1.1.1" && \
( "$BOARD_MODEL" == "PRO Z690-A WIFI DDR4(MS-7D25)" || \
"$BOARD_MODEL" == "PRO Z690-A DDR4(MS-7D25)" || \
"$BOARD_MODEL" == "PRO Z690-A (MS-7D25)" || \
"$BOARD_MODEL" == "PRO Z690-A WIFI (MS-7D25)" ) ]]; then
Comment on lines +924 to +927
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe replace with "$SYSTEM_MODEL" = "MS-7D25"?


cpu_gen_check=$($LSCPU | grep -F "Model name" | grep -E "\-(13|14)[0-9]{3}" | wc -l)

if [ $cpu_gen_check -ne 0 ]; then
echo "You have a 13th gen or above CPU and are trying to flash Dasharo v1.1.1 on a MSI PRO Z690-A DDR4 or DDR5 board"
echo "That version does not support gen 13 and above CPU. Therefore we cannot continue with flashing."
error_exit "Aborting update process..."
fi
fi

# Ask user for confirmation:
display_warning
Expand Down