summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2015-06-29 14:41:21 -0400
committerPeter Jones <pjones@redhat.com>2015-06-29 14:41:21 -0400
commitc55b17d281e428420198e37a4054cd13b5b3ca7e (patch)
treeb3bb4b00cefd405fb18f6dab15998484642c5c6e
parentfef725de4d25fcb8516935e8acb7f48369eb531e (diff)
downloadefi-boot-shim-c55b17d281e428420198e37a4054cd13b5b3ca7e.tar.gz
efi-boot-shim-c55b17d281e428420198e37a4054cd13b5b3ca7e.zip
Only be verbose the first time secure_mode() is called.
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>
-rw-r--r--shim.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/shim.c b/shim.c
index 751878f7..5daafb7f 100644
--- 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;
}