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

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