From 09a37bbc69f6c5d6c1d081f4f938f34cff412c4f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 27 Sep 2013 11:32:49 -0400 Subject: Make verbose stuff use console_notify Signed-off-by: Peter Jones --- shim.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'shim.c') diff --git a/shim.c b/shim.c index 8c4ef656..a72e0910 100644 --- a/shim.c +++ b/shim.c @@ -43,10 +43,12 @@ #include "replacements.h" #include "ucs2.h" +#include "console_control.h" #include "guid.h" #include "variables.h" #include "efiauthenticated.h" #include "security_policy.h" +#include "console.h" #define FALLBACK L"\\fallback.efi" #define MOK_MANAGER L"\\MokManager.efi" @@ -446,7 +448,7 @@ static BOOLEAN secure_mode (void) /* FIXME - more paranoia here? */ if (status != EFI_SUCCESS || sb != 1) { if (verbose) - Print(L"Secure boot not enabled\n"); + console_notify(L"Secure boot not enabled\n"); return FALSE; } @@ -456,7 +458,7 @@ static BOOLEAN secure_mode (void) if (status == EFI_SUCCESS && setupmode == 1) { if (verbose) - Print(L"Platform is in setup mode\n"); + console_notify(L"Platform is in setup mode\n"); return FALSE; } @@ -720,7 +722,7 @@ static EFI_STATUS verify_buffer (char *data, int datasize, if (status == EFI_SUCCESS) { if (verbose) - Print(L"Binary is whitelisted\n"); + console_notify(L"Binary is whitelisted\n"); return status; } @@ -733,7 +735,7 @@ static EFI_STATUS verify_buffer (char *data, int datasize, SHA256_DIGEST_SIZE)) { status = EFI_SUCCESS; if (verbose) - Print(L"Binary is verified by the vendor certificate\n"); + console_notify(L"Binary is verified by the vendor certificate\n"); return status; } @@ -747,7 +749,7 @@ static EFI_STATUS verify_buffer (char *data, int datasize, SHA256_DIGEST_SIZE)) { status = EFI_SUCCESS; if (verbose) - Print(L"Binary is verified by the vendor certificate\n"); + console_notify(L"Binary is verified by the vendor certificate\n"); return status; } @@ -1590,6 +1592,8 @@ EFI_STATUS efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *passed_systab) */ InitializeLib(image_handle, systab); + setup_console(1); + verbose_check_size = 1; efi_status = get_variable(L"SHIM_VERBOSE", (void *)&verbose_check, &verbose_check_size, global_var); @@ -1665,5 +1669,7 @@ EFI_STATUS efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *passed_systab) if (load_options_size > 0) FreePool(second_stage); + setup_console(0); + return efi_status; } -- cgit v1.2.3