Blame SOURCES/0479-Add-support-for-UEFI-operating-systems-returned-by-o.patch

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