dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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