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

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