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

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