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

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