]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/efi-loader.h
logind: also cache LoaderEntryOneShot EFI variable
[thirdparty/systemd.git] / src / shared / efi-loader.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
2e3d0692
LP
2#pragma once
3
0bb2f0f1 4#include "efivars.h"
7b4d7cc0 5
af2697e8
LP
6#include <sys/stat.h>
7
349cc4a5 8#if ENABLE_EFI
b28ce7c6 9
5bdf2243
JJ
10int efi_reboot_to_firmware_supported(void);
11int efi_get_reboot_to_firmware(void);
12int efi_set_reboot_to_firmware(bool value);
34e5a31e 13
0974a682
KS
14int efi_get_boot_option(uint16_t nr, char **title, sd_id128_t *part_uuid, char **path, bool *active);
15int efi_add_boot_option(uint16_t id, const char *title, uint32_t part, uint64_t pstart, uint64_t psize, sd_id128_t part_uuid, const char *path);
16int efi_remove_boot_option(uint16_t id);
9cde64ff 17int efi_get_boot_order(uint16_t **order);
0974a682 18int efi_set_boot_order(uint16_t *order, size_t n);
9cde64ff 19int efi_get_boot_options(uint16_t **options);
34e5a31e 20
c51d84dc
KS
21int efi_loader_get_device_part_uuid(sd_id128_t *u);
22int efi_loader_get_boot_usec(usec_t *firmware, usec_t *loader);
0974a682 23
bd2865ca
LP
24int efi_loader_get_entries(char ***ret);
25
80641a81
LP
26int efi_loader_get_features(uint64_t *ret);
27
e8df4eee 28int efi_loader_get_config_timeout_one_shot(usec_t *ret);
af2697e8 29int efi_loader_update_entry_one_shot_cache(char **cache, struct stat *cache_stat);
e8df4eee 30
b28ce7c6
TG
31#else
32
b28ce7c6
TG
33static inline int efi_reboot_to_firmware_supported(void) {
34 return -EOPNOTSUPP;
35}
36
37static inline int efi_get_reboot_to_firmware(void) {
38 return -EOPNOTSUPP;
39}
40
41static inline int efi_set_reboot_to_firmware(bool value) {
42 return -EOPNOTSUPP;
43}
44
b28ce7c6
TG
45static inline int efi_get_boot_option(uint16_t nr, char **title, sd_id128_t *part_uuid, char **path, bool *active) {
46 return -EOPNOTSUPP;
47}
48
49static inline int efi_add_boot_option(uint16_t id, const char *title, uint32_t part, uint64_t pstart, uint64_t psize, sd_id128_t part_uuid, const char *path) {
50 return -EOPNOTSUPP;
51}
52
53static inline int efi_remove_boot_option(uint16_t id) {
54 return -EOPNOTSUPP;
55}
56
57static inline int efi_get_boot_order(uint16_t **order) {
58 return -EOPNOTSUPP;
59}
60
61static inline int efi_set_boot_order(uint16_t *order, size_t n) {
62 return -EOPNOTSUPP;
63}
64
65static inline int efi_get_boot_options(uint16_t **options) {
66 return -EOPNOTSUPP;
67}
68
69static inline int efi_loader_get_device_part_uuid(sd_id128_t *u) {
70 return -EOPNOTSUPP;
71}
72
73static inline int efi_loader_get_boot_usec(usec_t *firmware, usec_t *loader) {
74 return -EOPNOTSUPP;
75}
76
bd2865ca
LP
77static inline int efi_loader_get_entries(char ***ret) {
78 return -EOPNOTSUPP;
79}
80
80641a81
LP
81static inline int efi_loader_get_features(uint64_t *ret) {
82 return -EOPNOTSUPP;
83}
84
e8df4eee
LP
85static inline int efi_loader_get_config_timeout_one_shot(usec_t *ret) {
86 return -EOPNOTSUPP;
87}
88
af2697e8
LP
89static inline int efi_loader_update_entry_one_shot_cache(char **cache, struct stat *cache_stat) {
90 return -EOPNOTSUPP;
91}
92
b28ce7c6
TG
93#endif
94
995cbd72
LP
95bool efi_loader_entry_name_valid(const char *s);
96
0974a682 97char *efi_tilt_backslashes(char *s);