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

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