Skip to content
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

Fix non-zero status exit on non secure boot system #2715

Merged
merged 2 commits into from
Mar 7, 2023
Merged
Changes from 1 commit
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
15 changes: 11 additions & 4 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,18 @@ if is_secureboot && grep -q aboot_machine= /host/machine.conf; then
load_aboot_secureboot_kernel
else
# check if secure boot is enable in UEFI
SECURE_UPGRADE_ENABLED=$(bootctl status 2>/dev/null | grep -c "Secure Boot: enabled")
if [ ${SECURE_UPGRADE_ENABLED} -eq 1 ]; then
load_kernel_secure
CHECK_SECURE_UPGRADE_ENABLED=0
SECURE_UPGRADE_ENABLED=$(bootctl status 2>/dev/null | grep -c "Secure Boot: enabled" || true) || CHECK_SECURE_UPGRADE_ENABLED=$?
yxieca marked this conversation as resolved.
Show resolved Hide resolved
if [[ CHECK_SECURE_UPGRADE_ENABLED -ne 0 ]]; then
error "CHECK_SECURE_UPGRADE_ENABLED failed"
else
load_kernel
if [[ ${SECURE_UPGRADE_ENABLED} -eq 1 ]]; then
debug "Loading kernel with secure boot"
load_kernel_secure
else
debug "Loading kernel without secure boot"
load_kernel
fi
yxieca marked this conversation as resolved.
Show resolved Hide resolved
fi
fi

Expand Down