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