From 0d706339c20409635d6db527f84dbc70da83da5054a4e486e87b6ed83a2c0cb3 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Fri, 5 Mar 2021 10:56:31 +0000 Subject: [PATCH] Accepting request 876961 from home:michael-chang:branches:Base:System - Fix chainloading windows on dual boot machine (bsc#1183073) OBS-URL: https://build.opensuse.org/request/show/876961 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=375 --- ...ed-image-as-shim-s-verifiable-object.patch | 41 +++++++++++++++++++ grub2.changes | 5 +++ grub2.spec | 2 + 3 files changed, 48 insertions(+) create mode 100644 0001-Add-chainloaded-image-as-shim-s-verifiable-object.patch diff --git a/0001-Add-chainloaded-image-as-shim-s-verifiable-object.patch b/0001-Add-chainloaded-image-as-shim-s-verifiable-object.patch new file mode 100644 index 0000000..4a33b1a --- /dev/null +++ b/0001-Add-chainloaded-image-as-shim-s-verifiable-object.patch @@ -0,0 +1,41 @@ +From eaed36ac87c3f8edeea67bf333700819e80ac732 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Fri, 5 Mar 2021 17:33:17 +0800 +Subject: [PATCH] Add chainloaded image as shim's verifiable object + +This fixed error in dual booting Microsoft Windows + +error ../../grub-core/kern/verifiers.c:119:verification requested but +nobody cares: /EFI/Microsoft/Boot/bootmgfw.efi. +--- + grub-core/kern/efi/sb.c | 1 + + grub-core/kern/lockdown.c | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/kern/efi/sb.c b/grub-core/kern/efi/sb.c +index 41dadcd14..96d237722 100644 +--- a/grub-core/kern/efi/sb.c ++++ b/grub-core/kern/efi/sb.c +@@ -129,6 +129,7 @@ shim_lock_verifier_init (grub_file_t io __attribute__ ((unused)), + case GRUB_FILE_TYPE_BSD_KERNEL: + case GRUB_FILE_TYPE_XNU_KERNEL: + case GRUB_FILE_TYPE_PLAN9_KERNEL: ++ case GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE: + *flags = GRUB_VERIFY_FLAGS_SINGLE_CHUNK; + + /* Fall through. */ +diff --git a/grub-core/kern/lockdown.c b/grub-core/kern/lockdown.c +index 0bc70fd42..e1fd1c1e2 100644 +--- a/grub-core/kern/lockdown.c ++++ b/grub-core/kern/lockdown.c +@@ -48,7 +48,6 @@ lockdown_verifier_init (grub_file_t io __attribute__ ((unused)), + case GRUB_FILE_TYPE_PXECHAINLOADER: + case GRUB_FILE_TYPE_PCCHAINLOADER: + case GRUB_FILE_TYPE_COREBOOT_CHAINLOADER: +- case GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE: + case GRUB_FILE_TYPE_ACPI_TABLE: + case GRUB_FILE_TYPE_DEVICE_TREE_IMAGE: + *flags = GRUB_VERIFY_FLAGS_DEFER_AUTH; +-- +2.26.2 + diff --git a/grub2.changes b/grub2.changes index d4d30b4..02334ca 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 5 09:41:07 UTC 2021 - Michael Chang + +- Fix chainloading windows on dual boot machine (bsc#1183073) + ------------------------------------------------------------------- Fri Feb 26 06:52:18 UTC 2021 - Michael Chang diff --git a/grub2.spec b/grub2.spec index b1ad19c..d3b6f01 100644 --- a/grub2.spec +++ b/grub2.spec @@ -390,6 +390,7 @@ Patch783: 0043-squash-Don-t-allow-insmod-when-secure-boot-is-enable.patch Patch784: 0044-squash-kern-Add-lockdown-support.patch Patch785: 0045-squash-Add-support-for-Linux-EFI-stub-loading-on-aar.patch Patch786: 0046-squash-verifiers-Move-verifiers-API-to-kernel-image.patch +Patch787: 0001-Add-chainloaded-image-as-shim-s-verifiable-object.patch Requires: gettext-runtime %if 0%{?suse_version} >= 1140 @@ -769,6 +770,7 @@ swap partition while in resuming %patch784 -p1 %patch785 -p1 %patch786 -p1 +%patch787 -p1 %build # collect evidence to debug spurious build failure on SLE15