zbyszek / rpms / grub2

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