konradr / rpms / grub2

Forked from rpms/grub2 6 years ago
Clone
f74b50e
From ec4b06bcd18d2df965df4a8d53c44ed034cd2d21 Mon Sep 17 00:00:00 2001
f74b50e
From: Matthew Garrett <matthew.garrett@nebula.com>
f74b50e
Date: Wed, 12 Jun 2013 11:51:49 -0400
f74b50e
Subject: [PATCH 479/482] Add support for UEFI operating systems returned by
f74b50e
 os-prober
f74b50e
f74b50e
os-prober returns UEFI operating systems in the form:
f74b50e
f74b50e
path:long-name:name
f74b50e
f74b50e
where path is the path under the EFI directory on the ESP. This is in
f74b50e
contrast to legacy OSes, where path is the device string. Handle this case.
f74b50e
---
f74b50e
 util/grub.d/30_os-prober.in | 22 ++++++++++++++++++----
f74b50e
 1 file changed, 18 insertions(+), 4 deletions(-)
f74b50e
f74b50e
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
f74b50e
index 04f32a1..f8ae241 100644
f74b50e
--- a/util/grub.d/30_os-prober.in
f74b50e
+++ b/util/grub.d/30_os-prober.in
f74b50e
@@ -274,9 +274,23 @@ EOF
f74b50e
 EOF
f74b50e
     ;;
f74b50e
     *)
f74b50e
-      echo -n "  "
f74b50e
-      # TRANSLATORS: %s is replaced by OS name.
f74b50e
-      gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2
f74b50e
-    ;;
f74b50e
+      case ${DEVICE} in
f74b50e
+	*.efi)
f74b50e
+	  cat << EOF
f74b50e
+menuentry '$(echo "${LONGNAME}" | grub_quote)' {
f74b50e
+EOF
f74b50e
+	  save_default_entry | grub_add_tab
f74b50e
+	  cat << EOF
f74b50e
+	  chainloader /EFI/${DEVICE}
f74b50e
+	  boot
f74b50e
+}
f74b50e
+EOF
f74b50e
+	  ;;
f74b50e
+	*)
f74b50e
+          echo -n "  "
f74b50e
+          # TRANSLATORS: %s is replaced by OS name.
f74b50e
+          gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2
f74b50e
+        ;;
f74b50e
+      esac
f74b50e
   esac
f74b50e
 done
f74b50e
-- 
f74b50e
1.8.2.1
f74b50e