Blame SOURCES/0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch

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