[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix screen coud be filled with leftover artifacts
From: |
Michael Chang |
Subject: |
Re: [PATCH] Fix screen coud be filled with leftover artifacts |
Date: |
Fri, 4 Oct 2024 09:25:36 +0800 |
On Thu, Oct 03, 2024 at 09:17:46PM GMT, Askar Safin wrote:
> ---- On Thu, 03 Oct 2024 11:23:08 +0400 Michael Chang via Grub-devel wrote
> ---
> > A regression in grub 2.12 causes the grub screen to become cluttered
>
> I just tested. Your patch doesn't fix anything for me!
Thank you for sharing the report. Let me try to explain what happened
here.
>
> (Note: I'm not GRUB developer, I'm just a user.)
>
> Hi. I'm annoyed by screen cluttering, too. So I applied this patch to see
> whether this will help.
> Unfortunately, it did not.
>
> Here is my test setup: I boot GRUB x86_64-efi in Qemu. My grub.cfg is so:
> ****
> echo "This is /EFI/debian/grub.cfg from main file system (iso9660)"
> echo "Testing shows that this file is loaded during UEFI-CD"
> sleep 10
> ****
>
> As you can see, my grub.cfg does "sleep 10" before GRUB command line. Also,
> note that there is no any "menuentry". So, menu is not shown.
>
> Okay, so what happens?
>
> Both with your patch and without your patch the following happens: I see
> message "This is /EFI/debian/grub.cfg from..." on screen with artifacts,
> then, after 10 seconds I switch to GRUB command line without artifacts.
To maintain the integrity of the flicker-free implementation, we cannot
enforce a universal clear screen to clean up any leftover artifacts at
the start. Therefore, if this doesn't occur automatically, you may need
to manually clear the screen by explicitly using the clear command, as
shown below:
****
clear
echo "This is /EFI/debian/grub.cfg from main file system (iso9660)"
echo "Testing shows that this file is loaded during UEFI-CD"
sleep 10
****
Please note that the clear command above will not work if you are
testing without the patch, as there is an inactive period for any
screen clearing attempts before text output occurs.
>
> So, yes, artifacts are not present at GRUB command line screen, but they ARE
> present (both with and without your patch) before we switch to GRUB command
> line.
You won’t notice a difference because some text is output before falling
into the grub command line (CLI). As part of the flicker-less patch,
the text output reinstates the clear function, allowing the screen to
clear properly before entering the CLI by itself.
However, the issue I encountered was that no text was output before
entering the CLI. As a result, all the screen clearing done at the code
level before the CLI didn’t take effect, leading to a cluttered screen.
This is what the patch is intended to deal with.
I hope this clarifies the issue a bit.
Thanks,
Michael
>
> Now let me describe my exact setup for testing this.
>
> I checked out GRUB's master branch. Then I compiled it so (both with and
> without your branch) (in debian sid x86_64 docker):
>
> ***
> ./bootstrap
> ./configure --prefix=/opt/grub --with-platform=efi
> make
> make install
> ***
>
> Note that freshly built GRUB got to /opt/grub.
>
> Then I built ".efi" file so (inside debian sid x86_64 docker):
>
> ***
> /opt/grub/bin/grub-mkimage -O x86_64-efi -o /tmp/grub.efi -d
> /opt/grub/lib/grub/x86_64-efi -p /EFI/debian all_video boot cat configfile
> echo fat font gfxmenu gfxterm gfxterm_background help iso9660 loadenv ls
> memdisk minicmd normal part_msdos part_gpt regexp search sleep test true video
> ***
>
> Then I built ".iso" file by this script (inside debian sid x86_64 docker):
> ***
> #!/bin/bash
> # This script creates isohybrid disk, which supports UEFI booting
> # The disk can be used both as CD image and as USB disk image
> # So, in total 2 boot modes are supported: UEFI-CD and UEFI-USB
> {
> # This is just boilerplate I insert to all my bash scripts
> set -e
> set -u
> set -o pipefail
> shopt -s inherit_errexit
> shopt -s nullglob
> export LC_ALL=C.UTF-8
>
> if [ $# != 1 ]; then
> echo "Usage: ${0##*/} OUT" >&2
> exit 1
> fi
>
> OUT="$1"
>
> DIR="$(mktemp -d /tmp/grub-XXXXXX)"
>
> mkdir -p "$DIR/esp/EFI/boot" "$DIR/esp/EFI/debian"
> "$DIR/main-root/EFI/debian" "$DIR/main-root/boot/grub"
> wget -O "$DIR/esp/EFI/boot/bootx64.efi"
> 'https://sources.debian.org/src/shim-signed/latest/shimx64.efi.signed/'
> mv /tmp/grub.efi "$DIR/esp/EFI/boot/grubx64.efi"
> cat << "EOF" > "$DIR/esp/EFI/debian/grub.cfg"
> echo "This is /EFI/debian/grub.cfg from ESP"
> echo "Testing shows that this file is loaded during UEFI-USB"
> sleep 10
> EOF
> mkfs.vfat -C "$DIR/main-root/boot/grub/efi.img" 10000
> mcopy -s -i "$DIR/main-root/boot/grub/efi.img" "$DIR/esp/EFI" ::/
> cat << "EOF" > "$DIR/main-root/EFI/debian/grub.cfg"
> echo "This is /EFI/debian/grub.cfg from main file system (iso9660)"
> echo "Testing shows that this file is loaded during UEFI-CD"
> sleep 10
> EOF
> # I don't know why this "$DIR/main-root/zero" is needed. Anyway this is
> just a demo
> dd if=/dev/zero of="$DIR/main-root/zero" bs=1M count=1
> xorriso -as mkisofs -b /zero -no-emul-boot --efi-boot /boot/grub/efi.img
> -efi-boot-part --efi-boot-image -o "$OUT" -r "$DIR/main-root"
> rm -r "$DIR"
> exit 0
> }
> ***
>
> Then I booted resulting .iso file in Qemu running on my host (debian bookworm
> x86_64) by this command:
> ***
> qemu-system-x86_64 -enable-kvm -m 4096 -bios OVMF.fd -cdrom /tmp/dx/o.iso
> ***
>
> Then in Qemu I saw text "This is /EFI/debian/grub.cfg from..." AND artifacts.
> Then, after 10 seconds I saw GRUB command line without artifacts. All these
> happened both with and without your patch, i. e. your patch doesn't fix
> anything for me.
>
> --
> Askar Safin
> https://types.pl/@safinaskar
>
>