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