From: Matthew Garrett <matthew.garr...@nebula.com>

os-prober returns UEFI operating systems in the form:

path:long-name:name

where path is the path under the EFI directory on the ESP. This is in
contrast to legacy OSes, where path is the device string. Handle this case.

[lkund...@v3.sk: Add Changelog]
---
Hi,

this is taken from Fedora (and RHEL) package as it is. I've only added the 
Changelog.

Please have a look and let me know if there's anything I could do to have his 
mainlined, so that we can get rid of the pile of patches we ship in Fedora.
Other Linux distributions interested in Linux on EFI support may find this 
useful too.

Thank you!
Lubo

 ChangeLog                   |  4 ++++
 util/grub.d/30_os-prober.in | 22 ++++++++++++++++++----
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 10abfe2..d33278f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-02-21  Matthew Garrett  <matthew.garr...@nebula.com>
+
+       * util/grub.d/30_os-prober.in: Chainload *.efi entries.
+
 2014-01-19  Colin Watson  <cjwat...@ubuntu.com>
 
        * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Ignore
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
index 7cf8487..390bb0e 100644
--- a/util/grub.d/30_os-prober.in
+++ b/util/grub.d/30_os-prober.in
@@ -319,9 +319,23 @@ EOF
 EOF
     ;;
     *)
-      echo -n "  "
-      # TRANSLATORS: %s is replaced by OS name.
-      gettext_printf "%s is not yet supported by grub-mkconfig.\n" 
"${LONGNAME}" >&2
-    ;;
+      case ${DEVICE} in
+       *.efi)
+         cat << EOF
+menuentry '$(echo "${LONGNAME}" | grub_quote)' {
+EOF
+         save_default_entry | grub_add_tab
+         cat << EOF
+         chainloader /EFI/${DEVICE}
+         boot
+}
+EOF
+         ;;
+       *)
+          echo -n "  "
+          # TRANSLATORS: %s is replaced by OS name.
+          gettext_printf "%s is not yet supported by grub-mkconfig.\n" 
"${LONGNAME}" >&2
+        ;;
+      esac
   esac
 done
-- 
1.8.3.1


_______________________________________________
Bug-grub mailing list
Bug-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-grub

Reply via email to