2012-11-28 10:34:03 +01:00
|
|
|
From 795ac61cba9674376d745813efdab395e35cff41 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Michael Chang <mchang@suse.com>
|
|
|
|
Date: Mon, 26 Nov 2012 15:38:54 +0800
|
|
|
|
Subject: [PATCH] provide option in config to enable linuxefi
|
|
|
|
|
|
|
|
References: fate#314485
|
|
|
|
Patch-Mainline: no
|
|
|
|
|
|
|
|
As linuxefi module requires kernel 3.6 or later which supports EFI
|
|
|
|
handover protocol, it may not be able to load kernels without that
|
|
|
|
supports in place.
|
|
|
|
|
|
|
|
In case that things would break, and the linuxefi is really too young to
|
|
|
|
take over the position of "linux" kernel loader module, we introduce a
|
|
|
|
option GRUB_USE_LINUXEFI in the config and only explicit set it to true
|
|
|
|
will enable it. Example usage is
|
|
|
|
|
|
|
|
GRUB_USE_LINUXEFI=true grub2-mkconfig -o /boot/efi/EFI/opensuse/grub.cfg
|
|
|
|
|
|
|
|
This will output a grub.cfg which uses linuxefi in replace of linux and
|
|
|
|
enable verification of kernel signature if in secureboot enabled and
|
|
|
|
has shim exported protocols available.
|
|
|
|
---
|
|
|
|
util/grub-mkconfig.in | 3 ++-
|
|
|
|
util/grub.d/10_linux.in | 4 ++--
|
|
|
|
2 files changed, 4 insertions(+), 3 deletions(-)
|
|
|
|
|
2019-10-18 12:18:53 +02:00
|
|
|
Index: grub-2.04~rc1/util/grub-mkconfig.in
|
2014-01-06 04:50:43 +01:00
|
|
|
===================================================================
|
2019-10-18 12:18:53 +02:00
|
|
|
--- grub-2.04~rc1.orig/util/grub-mkconfig.in
|
|
|
|
+++ grub-2.04~rc1/util/grub-mkconfig.in
|
|
|
|
@@ -271,7 +271,8 @@ export GRUB_DEFAULT \
|
2012-11-28 10:34:03 +01:00
|
|
|
GRUB_BADRAM \
|
2014-01-06 04:50:43 +01:00
|
|
|
GRUB_OS_PROBER_SKIP_LIST \
|
|
|
|
GRUB_DISABLE_SUBMENU \
|
2012-11-28 10:34:03 +01:00
|
|
|
- GRUB_CMDLINE_LINUX_RECOVERY
|
|
|
|
+ GRUB_CMDLINE_LINUX_RECOVERY \
|
|
|
|
+ GRUB_USE_LINUXEFI
|
|
|
|
|
|
|
|
if test "x${grub_cfg}" != "x"; then
|
|
|
|
rm -f "${grub_cfg}.new"
|
2019-10-18 12:18:53 +02:00
|
|
|
Index: grub-2.04~rc1/util/grub.d/10_linux.in
|
2014-01-06 04:50:43 +01:00
|
|
|
===================================================================
|
2019-10-18 12:18:53 +02:00
|
|
|
--- grub-2.04~rc1.orig/util/grub.d/10_linux.in
|
|
|
|
+++ grub-2.04~rc1/util/grub.d/10_linux.in
|
|
|
|
@@ -145,7 +145,7 @@ linux_entry ()
|
2012-11-28 10:34:03 +01:00
|
|
|
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
|
|
|
|
fi
|
|
|
|
message="$(gettext_printf "Loading Linux %s ..." ${version})"
|
|
|
|
- if [ -d /sys/firmware/efi ]; then
|
|
|
|
+ if [ -d /sys/firmware/efi ] && [ "x${GRUB_USE_LINUXEFI}" = "xtrue" ]; then
|
|
|
|
sed "s/^/$submenu_indentation/" << EOF
|
2015-10-30 11:01:48 +01:00
|
|
|
echo '$(echo "$message" | grub_quote)'
|
2015-10-06 10:47:39 +02:00
|
|
|
linuxefi ${rel_dirname}/${basename} ${root_device} ${args}
|
2019-10-18 12:18:53 +02:00
|
|
|
@@ -163,7 +163,7 @@ EOF
|
|
|
|
for i in ${initrd}; do
|
|
|
|
initrd_path="${initrd_path} ${rel_dirname}/${i}"
|
|
|
|
done
|
2012-11-28 10:34:03 +01:00
|
|
|
- if [ -d /sys/firmware/efi ]; then
|
|
|
|
+ if [ -d /sys/firmware/efi ] && [ "x${GRUB_USE_LINUXEFI}" = "xtrue" ]; then
|
|
|
|
sed "s/^/$submenu_indentation/" << EOF
|
2015-10-30 11:01:48 +01:00
|
|
|
echo '$(echo "$message" | grub_quote)'
|
2019-10-18 12:18:53 +02:00
|
|
|
initrdefi $(echo $initrd_path)
|