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