nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Peter Jones <pjones@redhat.com>
f725e3
Date: Mon, 16 Jul 2012 18:57:11 -0400
f725e3
Subject: [PATCH] Use "linuxefi" and "initrdefi" where appropriate.
f725e3
f725e3
---
f725e3
 util/grub.d/10_linux.in | 18 ++++++++++++++++--
f725e3
 1 file changed, 16 insertions(+), 2 deletions(-)
f725e3
f725e3
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
f725e3
index 00d193159e9..ad34cc02d36 100644
f725e3
--- a/util/grub.d/10_linux.in
f725e3
+++ b/util/grub.d/10_linux.in
f725e3
@@ -127,17 +127,31 @@ linux_entry ()
f725e3
     printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
f725e3
   fi
f725e3
   message="$(gettext_printf "Loading Linux %s ..." ${version})"
f725e3
-  sed "s/^/$submenu_indentation/" << EOF
f725e3
+  if [ -d /sys/firmware/efi ]; then
f725e3
+    sed "s/^/$submenu_indentation/" << EOF
f725e3
+	echo	'$(echo "$message" | grub_quote)'
f725e3
+	linuxefi ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
f725e3
+EOF
f725e3
+  else
f725e3
+    sed "s/^/$submenu_indentation/" << EOF
f725e3
 	echo	'$(echo "$message" | grub_quote)'
f725e3
 	linux	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
f725e3
 EOF
f725e3
+  fi
f725e3
   if test -n "${initrd}" ; then
f725e3
     # TRANSLATORS: ramdisk isn't identifier. Should be translated.
f725e3
     message="$(gettext_printf "Loading initial ramdisk ...")"
f725e3
-    sed "s/^/$submenu_indentation/" << EOF
f725e3
+    if [ -d /sys/firmware/efi ]; then
f725e3
+      sed "s/^/$submenu_indentation/" << EOF
f725e3
 	echo	'$(echo "$message" | grub_quote)'
f725e3
+	initrdefi ${rel_dirname}/${initrd}
f725e3
+EOF
f725e3
+    else
f725e3
+      sed "s/^/$submenu_indentation/" << EOF
f725e3
+	echo	'$message'
f725e3
 	initrd	${rel_dirname}/${initrd}
f725e3
 EOF
f725e3
+    fi
f725e3
   fi
f725e3
   sed "s/^/$submenu_indentation/" << EOF
f725e3
 }