dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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