Skip to content

Commit e16bdaa

Browse files
authored
Fix non-zero status exit on non secure boot system (#2715)
What I did Warm-reboot fails on kvm due to non-zero exit upon command bootctl status 2>/dev/null | grep -c "Secure Boot: enabled" How I did it Added || true to return 0 when previous command fails. Added CHECK_SECURE_UPGRADE_ENABLED to check output of previous command Added debug logs How to verify it Run warm-reboot on kvm and physical device when increased verbosity. Expects debug log to indicate secure/non secure boot. Successful warm reboot
1 parent 90d7015 commit e16bdaa

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/fast-reboot

+7-4
Original file line numberDiff line numberDiff line change
@@ -614,11 +614,14 @@ if is_secureboot && grep -q aboot_machine= /host/machine.conf; then
614614
load_aboot_secureboot_kernel
615615
else
616616
# check if secure boot is enable in UEFI
617-
SECURE_UPGRADE_ENABLED=$(bootctl status 2>/dev/null | grep -c "Secure Boot: enabled")
618-
if [ ${SECURE_UPGRADE_ENABLED} -eq 1 ]; then
619-
load_kernel_secure
620-
else
617+
CHECK_SECURE_UPGRADE_ENABLED=0
618+
SECURE_UPGRADE_ENABLED=$(bootctl status 2>/dev/null | grep -c "Secure Boot: enabled") || CHECK_SECURE_UPGRADE_ENABLED=$?
619+
if [[ CHECK_SECURE_UPGRADE_ENABLED -ne 0 ]]; then
620+
debug "Loading kernel without secure boot"
621621
load_kernel
622+
else
623+
debug "Loading kernel with secure boot"
624+
load_kernel_secure
622625
fi
623626
fi
624627

0 commit comments

Comments
 (0)