grub2/debian/patches/install_efi_fallback.patch
2013-11-15 10:21:26 +00:00

34 lines
1.1 KiB
Diff

Description: Fall back to i386-pc if booted using EFI but -efi is missing
It may be possible, particularly in recovery situations, to be booted using
EFI on x86 when only the i386-pc target is installed. There's nothing
actually stopping us installing i386-pc from an EFI environment, and it's
better than returning a confusing error.
Author: Colin Watson <cjwatson@ubuntu.com>
Forwarded: no
Last-Update: 2013-11-14
Index: b/util/grub-install.in
===================================================================
--- a/util/grub-install.in
+++ b/util/grub-install.in
@@ -249,7 +249,8 @@
linux*)
modprobe -q efivars 2>/dev/null || true ;;
esac
- if [ -d /sys/firmware/efi ]; then
+ if [ -d /sys/firmware/efi ] && \
+ [ -d "${libdir}/@PACKAGE@/x86_64-efi" ]; then
target="x86_64-efi"
else
target=i386-pc
@@ -265,7 +266,8 @@
linux*)
modprobe -q efivars 2>/dev/null || true ;;
esac
- if [ -d /sys/firmware/efi ]; then
+ if [ -d /sys/firmware/efi ] && \
+ [ -d "${libdir}/@PACKAGE@/i386-efi" ]; then
target="i386-efi"
elif [ -e /proc/device-tree ]; then
target=i386-pc