From a24eb74443aab70081e6b93bf4019669b61bd676ee90fc4a8d3e8b7474d4c99c Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Thu, 20 May 2021 01:28:18 +0000 Subject: [PATCH] Accepting request 894458 from home:gary_lin:branches:devel:openSUSE:Factory - shim-install: instead of assuming "removable" for Azure, remove fallback.efi from \EFI\Boot and copy grub.efi/cfg to \EFI\Boot to make \EFI\Boot bootable and keep the boot option created by efibootmgr (bsc#1185464, bsc#1185961) OBS-URL: https://build.opensuse.org/request/show/894458 OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim-leap?expand=0&rev=33 --- shim-install | 28 +++++++++++++++++++--------- shim-leap.changes | 8 ++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/shim-install b/shim-install index 66dc984..cfe6d31 100644 --- a/shim-install +++ b/shim-install @@ -221,15 +221,6 @@ do esac done -# bsc#1185464 -# The Azure firmware doesn't respect the boot option created by either -# efibootmgr or fallback.efi so we have to skip the installation of -# fallback.efi to avoid the endless reset loop. -if is_azure; then - no_nvram=yes - removable=yes -fi - if test -n "$efidir"; then efi_fs=`"$grub_probe" --target=fs "${efidir}"` if test "x$efi_fs" = xfat; then :; else @@ -441,3 +432,22 @@ if test "$no_nvram" = no && test -n "$bootloader_id"; then fi fi +# bsc#1185464 bsc#1185961 +# The Azure firmware sometimes doesn't respect the boot option created by +# either efibootmgr or fallback.efi so we have to remove fallback.efi to +# avoid the endless reset loop. +if is_azure; then + # Skip the workaround if we don't own \EFI\Boot or the removable + # option is used + if test "$update_boot" = "yes" && test "$removable" = "no"; then + # Remove fallback.efi which could cause the reset loop in Azure + rm -f "${efibootdir}/fallback.efi" + # Remove the older grub binary and config + rm -f "${efibootdir}/grub.efi" + rm -f "${efibootdir}/grub.cfg" + # Install new grub binary and config file to \EFI\Boot as + # the "removable" option + cp "${efidir}/grub.cfg" "${efibootdir}/grub.cfg" + cp "${efidir}/grub.efi" "${efibootdir}/grub.efi" + fi +fi diff --git a/shim-leap.changes b/shim-leap.changes index 6075853..c5f95eb 100644 --- a/shim-leap.changes +++ b/shim-leap.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu May 20 01:25:06 UTC 2021 - Gary Ching-Pang Lin + +- shim-install: instead of assuming "removable" for Azure, remove + fallback.efi from \EFI\Boot and copy grub.efi/cfg to \EFI\Boot + to make \EFI\Boot bootable and keep the boot option created by + efibootmgr (bsc#1185464, bsc#1185961) + ------------------------------------------------------------------- Fri May 7 08:54:20 UTC 2021 - Gary Ching-Pang Lin