On 01.06.2023 15:05, Roger Pau Monne wrote: > @@ -807,7 +830,41 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, > EFI_SYSTEM_TABLE *SystemTable > > if ( gop ) > { > - gop_mode = efi_find_gop_mode(gop, 0, 0, 0); > + const char *last = cmdline; > + unsigned int width = 0, height = 0, depth = 0; > + bool keep_current = false; > + > + while ( (last = get_option(last, "vga=")) != NULL ) > + { > + if ( !strncmp(last, "gfx-", 4) ) > + { > + width = simple_strtoul(last + 4, &last, 10); > + if ( *last == 'x' ) > + height = simple_strtoul(last + 1, &last, 10); > + if ( *last == 'x' ) > + depth = simple_strtoul(last + 1, &last, 10); > + if ( *last != ' ' && *last != '\t' && *last != '\0' && > + *last != ',' )
You check for an appropriate terminator here. > + width = height = depth = 0; > + keep_current = false; > + } > + else if ( !strncmp(last, "current", 7) ) Don't you also need to do so here, and maybe even ... > + keep_current = true; > + else if ( !strncmp(last, "keep", 4) ) > + { > + /* Ignore. */ ... here? Jan