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

[secure boot]Fix mokutil check issue with ONIE version older than 202… #14589

Merged
17 changes: 13 additions & 4 deletions installer/default_platform.conf
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,22 @@ bootloader_menu_config()
mv $onie_initrd_tmp/tmp/onie-support*.tar.bz2 $demo_mnt/$image_dir/

if [ "$firmware" = "uefi" ] ; then
secure_boot_state=$(mokutil --sb-state)
secure_boot_state=""
reg_sb_guid=""
ENABLED=1
reg_sb_guid=$(efivar -l | grep "SecureBoot")
if echo "$reg_sb_guid" | grep -q "SecureBoot";then
secure_boot_state=$(efivar -d --name $reg_sb_guid)
else
echo "Current UEFI do not support Secure Boot feature"
secure_boot_state="0"
fi
echo secure_boot_state=$secure_boot_state
if [ "$secure_boot_state" = "SecureBoot enabled" ]; then
echo "UEFI Secure Boot is enabled"
if [ "$secure_boot_state" -eq "$ENABLED" ]; then
echo "UEFI Secure Boot is enabled - Installing shim bootloader"
demo_install_uefi_shim "$demo_mnt" "$blk_dev"
else
echo "UEFI Secure Boot is disabled"
echo "UEFI Secure Boot is disabled - installing regular grub bootloader"
Copy link
Collaborator

@qiluo-msft qiluo-msft Apr 18, 2023

Choose a reason for hiding this comment

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

installing

Minor comment: the cases are not consistent.
Installing vs installing #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DONE

demo_install_uefi_grub "$demo_mnt" "$blk_dev"
fi
else
Expand Down