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

23d2ea
From 80fe9ed670d67991d5b52a8c85f22e0a2c35ccff 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
27a4da
Subject: [PATCH 112/260] 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
27a4da
index 6f38c82a5..9f955abb7 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
-- 
27a4da
2.13.0
606ea6