dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

23d2ea
From 7e496ebf185783ac12c0d85af7a734222ba98a65 Mon Sep 17 00:00:00 2001
606ea6
From: Peter Jones <pjones@redhat.com>
606ea6
Date: Mon, 16 Jul 2012 18:57:11 -0400
27a4da
Subject: [PATCH 092/260] 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
27a4da
index 00d193159..ad34cc02d 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
-- 
27a4da
2.13.0
606ea6