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

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