Hi Heinrich,

On 2026-07-31T08:57:24, Heinrich Schuchardt
<[email protected]> wrote:
> efi: avoid video ghosting in EFI app
>
> When running the EFI app via QEMU with EDK II using
>
>   cp /usr/share/OVMF/OVMF_VARS_4M.fd .
>   qemu-system-x86_64 -enable-kvm -m 2048 \
>     -machine q35,smm=on \
>     -drive 
> if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE_4M.fd \
>     -drive if=pflash,format=raw,file=OVMF_VARS_4M.fd \
>     -hda disk
>
> every character printed to the console by the U-Boot app appears twice. See
> https://gist.github.com/xypron/7214e785c7d73104f8541bcac363a192 .
>
> The reason is that environment variable stdout has serial,vidconsole as
> value. This is defined by board/efi/efi-x86_app/efi-x86_app.env including
> include/env/x86.env.
>
> Provide a proper efi-x86_app.env file which does not use vidconsole.
>
> [...]
>
> board/efi/efi-x86_app/efi-x86_app.env | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)

> diff --git a/board/efi/efi-x86_app/efi-x86_app.env 
> b/board/efi/efi-x86_app/efi-x86_app.env
> @@ -1,6 +1,17 @@
>  /* SPDX-License-Identifier: GPL-2.0+ */
> +
>  /*
>   * Copyright (c) 2015 Google, Inc
>   */
>
> -#include <env/x86.env>
> +netdev=eth0
> +consoledev=ttyS0
> +scriptaddr=0x7000000
> +kernel_addr_r=0x1000000
> +ramdisk_addr_r=0x4000000
> +ramdiskfile=initramfs.gz
> +
> +/* common console settings */
> +stdin=serial
> +stdout=serial
> +stderr=serial

Please can you keep '#include <env/x86.env>' and override just the
three console variables afterwards? env2string.awk uses vars[var] =
env, so a later assignment wins, and we avoid duplicating netdev,
consoledev, scriptaddr, kernel_addr_r, ramdisk_addr_r and ramdiskfile
— otherwise any future change to include/env/x86.env will drift away
from the EFI app.

Also, the previous include pulled in pciconfighost=1 which this
version silently drops. If that is intentional it deserves a mention
in the commit message; if not, the include-then-override approach
fixes it for free.

BTW an alternative is to leave x86.env alone and make the vidconsole
entries conditional on something like !defined(CONFIG_EFI_APP), so
efi-x86_payload.env and the other x86 boards keep sharing one source
of truth. What do you think?

Regards,
Simon

Reply via email to