efi_loader: reset colors before clearing screen
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 30 Apr 2022 07:05:04 +0000 (09:05 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 3 May 2022 19:39:22 +0000 (21:39 +0200)
When resetting the text console the colors have to be set before clearing
the screen. Otherwise the background color may be wrong.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_console.c

index ba68a15..60a3fc8 100644 (file)
@@ -522,11 +522,11 @@ static efi_status_t EFIAPI efi_cout_reset(
 {
        EFI_ENTRY("%p, %d", this, extended_verification);
 
-       /* Clear screen */
-       EFI_CALL(efi_cout_clear_screen(this));
        /* Set default colors */
        efi_con_mode.attribute = 0x07;
        printf(ESC "[0;37;40m");
+       /* Clear screen */
+       EFI_CALL(efi_cout_clear_screen(this));
 
        return EFI_EXIT(EFI_SUCCESS);
 }