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