[Bug 1711452] [NEW] grub.cfg fails back to 'text' video mode on UEFI which is not supported
Steve Langasek
steve.langasek at canonical.com
Thu Aug 17 20:28:43 UTC 2017
Public bug reported:
The grub.cfg generated by update-grub for both UEFI and BIOS includes
the following logic:
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
[...]
menuentry [...]
gfxmode $linux_gfx_mode
This means that in some cases, we are calling 'set gfxpayload="text"' on
UEFI systems.
However, grub-core/loader/i386/linux.c has:
#ifdef GRUB_MACHINE_EFI
#include <grub/efi/efi.h>
#define HAS_VGA_TEXT 0
#define DEFAULT_VIDEO_MODE "auto"
#define ACCEPTS_PURE_TEXT 0
#elif [...]
and if ACCEPTS_PURE_TEXT is 0, grub_linux_boot() masks
GRUB_VIDEO_MODE_TYPE_PURE_TEXT out of the allowed set when calling
grub_video_set_mode().
So our generated grub.cfg should *never* be setting gfxpayload=text on a
UEFI system. If we do, we get the following error message from grub at
boot:
error: invalid video mode specification `text'.
Booting in blind mode
** Affects: grub2 (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1711452
Title:
grub.cfg fails back to 'text' video mode on UEFI which is not
supported
Status in grub2 package in Ubuntu:
New
Bug description:
The grub.cfg generated by update-grub for both UEFI and BIOS includes
the following logic:
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
[...]
menuentry [...]
gfxmode $linux_gfx_mode
This means that in some cases, we are calling 'set gfxpayload="text"'
on UEFI systems.
However, grub-core/loader/i386/linux.c has:
#ifdef GRUB_MACHINE_EFI
#include <grub/efi/efi.h>
#define HAS_VGA_TEXT 0
#define DEFAULT_VIDEO_MODE "auto"
#define ACCEPTS_PURE_TEXT 0
#elif [...]
and if ACCEPTS_PURE_TEXT is 0, grub_linux_boot() masks
GRUB_VIDEO_MODE_TYPE_PURE_TEXT out of the allowed set when calling
grub_video_set_mode().
So our generated grub.cfg should *never* be setting gfxpayload=text on
a UEFI system. If we do, we get the following error message from grub
at boot:
error: invalid video mode specification `text'.
Booting in blind mode
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1711452/+subscriptions
More information about the foundations-bugs
mailing list