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

6b3c76
From 80fe9ed670d67991d5b52a8c85f22e0a2c35ccff 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
6b3c76
Subject: [PATCH 112/261] Add support for UEFI operating systems returned by
6b3c76
 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
6b3c76
index 6f38c82a5..9f955abb7 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
6b3c76
-- 
6b3c76
2.13.5
6b3c76