File: efi-keytool.c

package info (click to toggle)
efitools 1.9.2-3.5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 940 kB
  • sloc: ansic: 7,547; makefile: 131; perl: 119; sh: 35
file content (34 lines) | stat: -rw-r--r-- 617 bytes parent folder | download
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
/*
 * 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>

#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;
}