dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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