video: skip 'text' gfxpayload if not supported, to fallback to default
PATCH 1/1 video: skip 'text' gfxpayload if not supported, to fallback to default
On UEFI, 'text' gfxpayload is not supported, but we still reach parse_modespec with it, which will obviously fail. Fortunately, whatever gfxpayload is set, we still still have the 'auto' default to fall back to. Allow getting to this fallback by not trying to parse 'text' as a modespec.
This is because 'text' correctly doesn't parse as a modespec, and ought to have been ignored before we got to that point, just like it is immediately picked if we're running on a system where 'text' is a supported video mode.
Patch-Name: skip_text_gfxpayload_where_not_supported.patch
--- grub-core/video/video.c | 2 ++ 1 file changed, 2 insertions(+)
grub-core/video/video.c +2 -0
@@ -663,6 +663,8 @@ grub_video_set_mode (const char *modestring,return GRUB_ERR_NONE ; } +else +continue ; } err =parse_modespec (current_mode, &width, &height, &depth);
Signature · 1 line
2.20.1
Quoted 5 lines · Mathieu Trudel-Lapierre
On UEFI, 'text' gfxpayload is not supported, but we still reach
parse_modespecwith it, which will obviously fail. Fortunately, whatever gfxpayload is set, we still still have the 'auto' default to fall back to. Allow getting to this fallback by not trying to parse 'text' as a modespec.
Quoted 7 lines
This is because 'text' correctly doesn't parse as a modespec, and ought to have been ignored before we got to that point, just like it is immediately picked if we're running on a system where 'text' is a supported video mode.
Signed-off-by Mathieu Trudel-Lapierre <[email protected]>
If there are no objections I will push it next week.
Daniel
Quoted 9 lines · Daniel Kiper
Quoted 8 lines · Mathieu Trudel-Lapierre
On UEFI, 'text' gfxpayload is not supported, but we still reach
parse_modespecwith it, which will obviously fail. Fortunately, whatever gfxpayload is set, we still still have the 'auto' default to fall back to. Allow getting to this fallback by not trying to parse 'text' as a modespec.This is because 'text' correctly doesn't parse as a modespec, and ought to have been ignored before we got to that point, just like it is immediately picked if we're running on a system where 'text' is a supported video mode.
As an aside, in a grub.cfg intended for both legacy and UEFI booting, can I condition setting either 'vga=normal' or 'gfxpayload=text' depending on the context detected by grub? If yes, how?
Best,
Didier
Quoted 8 lines · Didier Spaier
Quoted 6 lines · Daniel Kiper
Quoted 5 lines · Mathieu Trudel-Lapierre
On UEFI, 'text' gfxpayload is not supported, but we still reach
parse_modespecwith it, which will obviously fail. Fortunately, whatever gfxpayload is set, we still still have the 'auto' default to fall back to. Allow getting to this fallback by not trying to parse 'text' as a modespec.
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
This is because 'text' correctly doesn't parse as a modespec, and ought to have been ignored before we got to that point, just like it is immediately picked if we're running on a system where 'text' is a supported video mode.
As an aside, in a grub.cfg intended for both legacy and UEFI booting, can I condition setting either 'vga=normal' or 'gfxpayload=text' depending on the context detected by grub? If yes, how?
In grub.cfg; you can check if you're on the right platform by checking
$grub_platform
On UEFI, it will read "efi".
Signature · 3 lines
Mathieu Trudel-Lapierre <[email protected]> Freenode: cyphermox, Jabber: [email protected] 4096R/65B58DA1 818A D123 0992 275B 23C2 CF89 C67B B4D6 65B5 8DA1
Quoted 18 lines · Mathieu Trudel-Lapierre
Quoted 8 lines · Didier Spaier
Quoted 6 lines · Daniel Kiper
Quoted 5 lines · Mathieu Trudel-Lapierre
On UEFI, 'text' gfxpayload is not supported, but we still reach
parse_modespecwith it, which will obviously fail. Fortunately, whatever gfxpayload is set, we still still have the 'auto' default to fall back to. Allow getting to this fallback by not trying to parse 'text' as a modespec.Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
This is because 'text' correctly doesn't parse as a modespec, and ought to have been ignored before we got to that point, just like it is immediately picked if we're running on a system where 'text' is a supported video mode.
As an aside, in a grub.cfg intended for both legacy and UEFI booting, can I condition setting either 'vga=normal' or 'gfxpayload=text' depending on the context detected by grub? If yes, how?
Quoted 5 lines
In grub.cfg; you can check if you're on the right platform by checking
$grub_platform
On UEFI, it will read "efi".
Thanks!