Hi Valentin,

On 2026-09-19T21:52:07, Valentin Haudiquet
<[email protected]> wrote:
> efi_loader: efi_console: find vidconsole when stdout is a list
>
> query_vidconsole() matched the stdout environment value with a strncmp
> against "vidconsole", but stdout may be a comma-separated list (e.g.
> "serial,vidconsole"); match the substring instead.

Please can you start with the user-visible problem, e.g. that EFI
output ends up in an 80x25 area of a larger panel.

>
> Signed-off-by: Valentin Haudiquet <[email protected]>
>
> lib/efi_loader/efi_console.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
> @@ -344,7 +344,8 @@ static int __maybe_unused query_vidconsole(int *rows, int 
> *cols)
> -     if (!stdout_name || strncmp(stdout_name, "vidconsole", 10))
> +     /* stdout may be a comma-separated list, e.g. "serial,vidconsole" */
> +     if (!stdout_name || !strstr(stdout_name, "vidconsole"))
>               return -ENODEV;

With "serial,vidconsole" the output goes to both devices, but with
this change query_console_serial() is never called. If the panel is
larger than the serial terminal, an EFI app such as GRUB positions the
cursor for the panel size and the serial output is garbled. So anyone
using serial as their main console swaps one problem for another. When
both devices are in the list, how about querying both and using the
smaller rows and cols? That works in either order. What do you think?

Also, strstr() matches any name containing vidconsole, e.g.
vidconsole1, but the code then looks up vidconsole by name anyway. It
would be better to split the list and look up the exact entry that
matched.

Regards,
Simon

Reply via email to