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