aboutsummaryrefslogtreecommitdiffstats
path: root/efi-keytool.c
blob: 849f8546e2bda36a180129086ad8b93384ecafc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright 2013 <James.Bottomley@HansenPartnership.com>
 *
 * see COPYING file
 */

#include <stdlib.h>
#include <stdint.h>
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

#define __STDC_VERSION__ 199901L
#include <efi.h>

#include <kernel_efivars.h>

int
main(int argc, char *argv[])
{
	int setup_mode;

	kernel_variable_init();
	setup_mode = variable_is_setupmode();

	printf("Platform is in %s\n", setup_mode ? "Setup Mode" : "User Mode");
	printf("Secure boot is %s\n", variable_is_secureboot() ? "on" : "off");

	return 0;
}