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