don't set gfxpayload in efi mode - backport upstream r3402

This commit is contained in:
Mads Kiilerich 2011-10-27 17:09:09 +02:00 committed by Peter Jones
parent dfcf823ef8
commit b4e6bbb0ec
2 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,63 @@
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Subject: Don't accept text modes on EFI when booting Linux.
Date: 2011-08-16 16:11:10 +0200
------------------------------------------------------------
revno: 3402
committer: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
branch nick: grub
timestamp: Tue 2011-08-16 16:11:10 +0200
message:
Don't accept text modes on EFI when booting Linux.
* grub-core/loader/i386/linux.c (ACCEPTS_PURE_TEXT): New define.
(grub_linux_boot) [!ACCEPTS_PURE_TEXT]: Restrict to graphics modes.
diff:
=== modified file 'grub-core/loader/i386/linux.c'
--- a/grub-core/loader/i386/linux.c 2011-05-18 07:56:33 +0000
+++ b/grub-core/loader/i386/linux.c 2011-08-16 14:11:10 +0000
@@ -45,15 +45,18 @@
#include <grub/efi/efi.h>
#define HAS_VGA_TEXT 0
#define DEFAULT_VIDEO_MODE "auto"
+#define ACCEPTS_PURE_TEXT 0
#elif defined (GRUB_MACHINE_IEEE1275)
#include <grub/ieee1275/ieee1275.h>
#define HAS_VGA_TEXT 0
#define DEFAULT_VIDEO_MODE "text"
+#define ACCEPTS_PURE_TEXT 1
#else
#include <grub/i386/pc/vbe.h>
#include <grub/i386/pc/console.h>
#define HAS_VGA_TEXT 1
#define DEFAULT_VIDEO_MODE "text"
+#define ACCEPTS_PURE_TEXT 1
#endif
#define GRUB_LINUX_CL_OFFSET 0x1000
@@ -483,12 +486,22 @@
tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar);
if (! tmp)
return grub_errno;
+#if ACCEPTS_PURE_TEXT
err = grub_video_set_mode (tmp, 0, 0);
+#else
+ err = grub_video_set_mode (tmp, GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0);
+#endif
grub_free (tmp);
}
else
- err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0);
-
+ {
+#if ACCEPTS_PURE_TEXT
+ err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0);
+#else
+ err = grub_video_set_mode (DEFAULT_VIDEO_MODE,
+ GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0);
+#endif
+ }
if (err)
{
grub_print_error ();

View File

@ -35,6 +35,7 @@ Patch2: grub-1.99-just-say-linux.patch
Patch3: grub-1.99-Workaround-for-variable-set-but-not-used-issue.patch Patch3: grub-1.99-Workaround-for-variable-set-but-not-used-issue.patch
Patch4: grub2-handle-initramfs-on-xen.patch Patch4: grub2-handle-initramfs-on-xen.patch
Patch5: grub2-1.99-handle-more-dmraid.patch Patch5: grub2-1.99-handle-more-dmraid.patch
Patch6: grub2-gfxpayload-efi.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)