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