summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2023-01-18 22:25:00 +0100
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-01-20 16:38:52 +0100
commitde94f0f3209e27ff36b264c58d5e6a8d54e07c65 (patch)
tree806071fcd26f1a91f24fcb110a1a9df38a905415
parent5ef229a007b19caa03228531ef32ac4cd5f25239 (diff)
efi_loader: Set default console colors on efi_cout_clear_screen if needed
Ensures a consistent background color of the whole screen for succeeding outputs as both demanded by the spec and implemented in EDK2 as well. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-rw-r--r--lib/efi_loader/efi_console.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 4d08dd3763..9316995073 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -489,6 +489,12 @@ static efi_status_t EFIAPI efi_cout_clear_screen(
{
EFI_ENTRY("%p", this);
+ /* Set default colors if not done yet */
+ if (efi_con_mode.attribute == 0) {
+ efi_con_mode.attribute = 0x07;
+ printf(ESC "[0;37;40m");
+ }
+
efi_clear_screen();
return EFI_EXIT(EFI_SUCCESS);