]> git.proxmox.com Git - efi-boot-shim.git/commitdiff
Only be verbose the first time secure_mode() is called.
authorPeter Jones <pjones@redhat.com>
Sun, 21 Jun 2015 20:51:28 +0000 (16:51 -0400)
committerPeter Jones <pjones@redhat.com>
Mon, 29 Jun 2015 18:41:21 +0000 (14:41 -0400)
It's annoying to find out we're not in SB mode over and over.  Really it
is.

Signed-off-by: Peter Jones <pjones@redhat.com>
shim.c

diff --git a/shim.c b/shim.c
index 751878f77053b6c34eaee4d1b43fdec0a80e82bf..5daafb7f4f9ad67ebd9fc2e48e092f03605643c9 100644 (file)
--- a/shim.c
+++ b/shim.c
@@ -613,12 +613,14 @@ static EFI_STATUS check_whitelist (WIN_CERTIFICATE_EFI_PKCS *cert,
 
 static BOOLEAN secure_mode (void)
 {
+       static int first = 1;
        if (user_insecure_mode)
                return FALSE;
 
        if (variable_is_secureboot() != 1) {
-               if (verbose && !in_protocol)
+               if (verbose && !in_protocol && first)
                        console_notify(L"Secure boot not enabled");
+               first = 0;
                return FALSE;
        }
 
@@ -629,11 +631,13 @@ static BOOLEAN secure_mode (void)
         * to consider it.
         */
        if (variable_is_setupmode(0) == 1) {
-               if (verbose && !in_protocol)
+               if (verbose && !in_protocol && first)
                        console_notify(L"Platform is in setup mode");
+               first = 0;
                return FALSE;
        }
 
+       first = 0;
        return TRUE;
 }