]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/fundamental/efivars-fundamental.h
fe34e6c714a10dd7ba8addcf8e71befaba9ae2a6
[thirdparty/systemd.git] / src / fundamental / efivars-fundamental.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include <errno.h>
5 #include "string-util-fundamental.h"
6
7 /* Features of the loader, i.e. systemd-boot */
8 #define EFI_LOADER_FEATURE_CONFIG_TIMEOUT (UINT64_C(1) << 0)
9 #define EFI_LOADER_FEATURE_CONFIG_TIMEOUT_ONE_SHOT (UINT64_C(1) << 1)
10 #define EFI_LOADER_FEATURE_ENTRY_DEFAULT (UINT64_C(1) << 2)
11 #define EFI_LOADER_FEATURE_ENTRY_ONESHOT (UINT64_C(1) << 3)
12 #define EFI_LOADER_FEATURE_BOOT_COUNTING (UINT64_C(1) << 4)
13 #define EFI_LOADER_FEATURE_XBOOTLDR (UINT64_C(1) << 5)
14 #define EFI_LOADER_FEATURE_RANDOM_SEED (UINT64_C(1) << 6)
15 #define EFI_LOADER_FEATURE_LOAD_DRIVER (UINT64_C(1) << 7)
16 #define EFI_LOADER_FEATURE_SORT_KEY (UINT64_C(1) << 8)
17 #define EFI_LOADER_FEATURE_SAVED_ENTRY (UINT64_C(1) << 9)
18 #define EFI_LOADER_FEATURE_DEVICETREE (UINT64_C(1) << 10)
19
20 /* Features of the stub, i.e. systemd-stub */
21 #define EFI_STUB_FEATURE_REPORT_BOOT_PARTITION (UINT64_C(1) << 0)
22 #define EFI_STUB_FEATURE_PICK_UP_CREDENTIALS (UINT64_C(1) << 1)
23 #define EFI_STUB_FEATURE_PICK_UP_SYSEXTS (UINT64_C(1) << 2)
24 #define EFI_STUB_FEATURE_THREE_PCRS (UINT64_C(1) << 3)
25
26 typedef enum SecureBootMode {
27 SECURE_BOOT_UNSUPPORTED,
28 SECURE_BOOT_DISABLED,
29 SECURE_BOOT_UNKNOWN,
30 SECURE_BOOT_AUDIT,
31 SECURE_BOOT_DEPLOYED,
32 SECURE_BOOT_SETUP,
33 SECURE_BOOT_USER,
34 _SECURE_BOOT_MAX,
35 _SECURE_BOOT_INVALID = -EINVAL,
36 } SecureBootMode;
37
38 const sd_char *secure_boot_mode_to_string(SecureBootMode m);
39 SecureBootMode decode_secure_boot_mode(bool secure, bool audit, bool deployed, bool setup);