From 339e843f5348be21227f39e248b9efe7fd226d722a12b6bb76e89828ddb7bd8b Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Sat, 6 Apr 2013 07:19:14 +0000 Subject: [PATCH] Accepting request 162967 from home:arvidjaar:bnc:810912 - add grub2-secureboot-use-linuxefi-on-uefi-in-os-prober.patch (bnc#810912) * use linuxefi in 30_os-prober if secure boot is enabled OBS-URL: https://build.opensuse.org/request/show/162967 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=38 --- ...ot-use-linuxefi-on-uefi-in-os-prober.patch | 54 +++++++++++++++++++ grub2.changes | 6 +++ grub2.spec | 2 + 3 files changed, 62 insertions(+) create mode 100644 grub2-secureboot-use-linuxefi-on-uefi-in-os-prober.patch diff --git a/grub2-secureboot-use-linuxefi-on-uefi-in-os-prober.patch b/grub2-secureboot-use-linuxefi-on-uefi-in-os-prober.patch new file mode 100644 index 0000000..b401676 --- /dev/null +++ b/grub2-secureboot-use-linuxefi-on-uefi-in-os-prober.patch @@ -0,0 +1,54 @@ +From: Andrey Borzenkov +Subject: use linuxefi/initrdefi for Linux in 30_os-prober if secure boot is enabled +Reference: bnc#810912 + +Emit linuxefi/initrdefi for os-prober detected Linux installations if +secure boot is enabled. +Index: grub-2.00/util/grub.d/30_os-prober.in +=================================================================== +--- grub-2.00.orig/util/grub.d/30_os-prober.in ++++ grub-2.00/util/grub.d/30_os-prober.in +@@ -41,6 +41,15 @@ if [ -z "${OSPROBED}" ] ; then + exit 0 + fi + ++# If secure boot is enabled, use linuxefi/initrdefi for Linux (bnc#810912) ++if [ -d /sys/firmware/efi ] && [ "x${GRUB_USE_LINUXEFI}" = "xtrue" ]; then ++ LINUX_LOADER_CMD=linuxefi ++ LINUX_INITRD_CMD=initrdefi ++else ++ LINUX_LOADER_CMD=linux ++ LINUX_INITRD_CMD=initrd ++fi ++ + osx_entry() { + if [ x$2 = x32 ]; then + # TRANSLATORS: it refers to kernel architecture (32-bit) +@@ -207,11 +216,11 @@ EOF + save_default_entry | sed -e "s/^/\t/" + printf '%s\n' "${prepare_boot_cache}" + cat << EOF +- linux ${LKERNEL} ${LPARAMS} ++ ${LINUX_LOADER_CMD} ${LKERNEL} ${LPARAMS} + EOF + if [ -n "${LINITRD}" ] ; then + cat << EOF +- initrd ${LINITRD} ++ ${LINUX_INITRD_CMD} ${LINITRD} + EOF + fi + cat << EOF +@@ -227,11 +236,11 @@ EOF + save_default_entry | sed -e "s/^/\t\t/" + printf '%s\n' "${prepare_boot_cache}" | sed -e "s/^/\t/" + cat << EOF +- linux ${LKERNEL} ${LPARAMS} ++ ${LINUX_LOADER_CMD} ${LKERNEL} ${LPARAMS} + EOF + if [ -n "${LINITRD}" ] ; then + cat << EOF +- initrd ${LINITRD} ++ ${LINUX_INITRD_CMD} ${LINITRD} + EOF + fi + cat << EOF diff --git a/grub2.changes b/grub2.changes index 0c3e762..b7f0fcd 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 5 17:01:42 UTC 2013 - arvidjaar@gmail.com + +- add grub2-secureboot-use-linuxefi-on-uefi-in-os-prober.patch (bnc#810912) + * use linuxefi in 30_os-prober if secure boot is enabled + ------------------------------------------------------------------- Wed Apr 3 17:56:20 UTC 2013 - arvidjaar@gmail.com diff --git a/grub2.spec b/grub2.spec index 5ad50bf..ceee4d7 100644 --- a/grub2.spec +++ b/grub2.spec @@ -138,6 +138,7 @@ Patch30: grub2-cdpath.patch Patch31: efidisk-ahci-workaround Patch32: grub2-grub-mount-return-failure-if-FUSE-failed.patch Patch33: grub2-fix-tftp-endianness.patch +Patch34: grub2-secureboot-use-linuxefi-on-uefi-in-os-prober.patch Requires: gettext-runtime %if 0%{?suse_version} >= 1140 Requires: os-prober @@ -258,6 +259,7 @@ mv docs/grub.texi docs/grub2.texi %patch31 -p1 %patch32 -p1 %patch33 -p1 +%patch34 -p1 # README.openSUSE cp %{SOURCE3} .