[arkdep] Do not error on failed bootctl set-default

Buggy firmware or otherwise flawed firmware implementations may fail to perform this step. Having it completely discard the deployment because of it would fully break Arkdep on affected systems.
This commit is contained in:
Dennis ten Hoove 2024-08-05 23:14:02 +02:00
parent 46ee6071b8
commit 8e303e6425
No known key found for this signature in database
GPG key ID: 2BA91DC2563B83D1

4
arkdep
View file

@ -824,7 +824,7 @@ deploy () {
# Lets ensure the latest deployment is active, even if it is already deployed
if [[ latest_image_always_default -eq 1 ]] && [[ ! $ARKDEP_NO_BOOTCTL -eq 1 ]]; then
# Allow it to error, it is no big deal if it does
bootctl set-default ${data[0]}.conf || printf '\e[1;33m<!>\e[0m\e[1m Failed to set default bootloader entry on latest_image_always_default\e[0m\n'
bootctl set-default ${data[0]}.conf || printf '\e[1;33m<!>\e[0m\e[1m Failed to set default bootloader entry, this might be a firmware bug\e[0m\n'
fi
printf "\e[1;33m<!>\e[0m\e[1m ${data[0]} is already deployed, canceling deployment\e[0m\n"
@ -1119,7 +1119,7 @@ deploy () {
printf '\e[1;34m-->\e[0m\e[1m Setting new bootloader entry as default\e[0m\n'
# Do not set default boot entry if ARKDEP_NO_BOOTCTL is set
if [[ ! $ARKDEP_NO_BOOTCTL -eq 1 ]]; then
bootctl set-default ${data[0]}.conf || cleanup_and_quit "Failed to set default bootloader entry"
bootctl set-default ${data[0]}.conf || printf '\e[1;33m<!>\e[0m\e[1m Failed to set default bootloader entry, this might be a firmware bug\e[0m\n'
else
printf '\e[1;33m<!>\e[0m\e[1m Not running bootctl set-default because overwritten with ARKDEP_NO_BOOTCTL\e[0m\n'
fi