Skip to content

Commit

Permalink
distro: dts: improve UX of update process
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Żyjewski <[email protected]>
  • Loading branch information
TomaszAIR committed Jan 11, 2024
1 parent cc07fb8 commit dafd803
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions meta-dts-distro/recipes-dts/dts/dasharo-deploy/dasharo-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ smbios_migration() {
}

smmstore_migration() {
echo "Backing up firmware configuration... "
echo -n "Backing up firmware configuration... "
flashrom -p "$PROGRAMMER_BIOS" ${FLASH_CHIP_SELECT} -r /tmp/dasharo_dump.rom ${FLASHROM_ADD_OPT_READ} --fmap -i FMAP -i SMMSTORE >> $FLASHROM_LOG_FILE 2>> $ERR_LOG_FILE
cbfstool /tmp/dasharo_dump.rom read -r SMMSTORE -f /tmp/smmstore.bin >> $ERR_LOG_FILE 2>&1 || \
print_warning "Failed! Default settings will be used."
Expand All @@ -240,7 +240,7 @@ bootsplash_migration() {
# If no custom logo, return from bootsplash_migration early and don't show
# unnecessary messages
cbfstool /tmp/dasharo_dump.rom extract -r BOOTSPLASH -n logo.bmp -f /tmp/logo.bmp >> $ERR_LOG_FILE 2>&1 || return 1
echo "Backing up custom boot logo... "
echo -n "Backing up custom boot logo... "
cbfstool $BIOS_UPDATE_FILE remove -n logo.bmp -r BOOTSPLASH >> $ERR_LOG_FILE 2>&1 || \
print_warning "Failed! Default boot splash will be used."
cbfstool $BIOS_UPDATE_FILE add -f /tmp/logo.bmp -r BOOTSPLASH -n logo.bmp -t raw -c lzma >> $ERR_LOG_FILE 2>&1 || \
Expand Down
9 changes: 5 additions & 4 deletions meta-dts-distro/recipes-dts/dts/dts/dts-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ compare_versions() {
}

download_artifacts() {
echo "Downloading Dasharo firmware..."
echo -n "Downloading Dasharo firmware..."
if [ -v BIOS_LINK_COMM ] && [ ${BIOS_LINK} == ${BIOS_LINK_COMM} ]; then
curl -s -L -f "$BIOS_LINK" -o $BIOS_UPDATE_FILE
error_check "Cannot access $FW_STORE_URL while downloading binary. Please
Expand Down Expand Up @@ -693,6 +693,7 @@ download_artifacts() {
check your internet connection"
fi
fi
print_green "Done"
}

download_keys() {
Expand All @@ -705,7 +706,7 @@ download_keys() {
}

get_signing_keys() {
echo "Getting platform specific GPG key... "
echo -n "Getting platform specific GPG key... "
wget -q https://raw.githubusercontent.com/3mdeb/3mdeb-secpack/master/$PLATFORM_SIGN_KEY -O - | gpg --import - >> $ERR_LOG_FILE 2>&1
error_check "Cannot get platform specific key to verify signatures."
print_green "Done"
Expand Down Expand Up @@ -733,12 +734,12 @@ verify_artifacts() {
*)
;;
esac
echo "Checking $_name firmware checksum..."
echo -n "Checking $_name firmware checksum..."
sha256sum --check <(echo $(cat $_hash_file | cut -d ' ' -f 1) $_update_file) >> $ERR_LOG_FILE 2>&1
error_check "Failed to verify $_name firmware checksum"
print_green "Done"
if [ -v PLATFORM_SIGN_KEY ]; then
echo "Checking $_name firmware signature..."
echo -n "Checking $_name firmware signature..."
(cat $_hash_file) | gpg --verify $_sign_file -
error_check "Failed to verify $_name firmware signature."
fi
Expand Down

0 comments on commit dafd803

Please sign in to comment.