Add support for GPG signature enforcement on booted
[petitboot] / discover / boot.h
1 #ifndef _BOOT_H
2 #define _BOOT_H
3
4 #include <types/types.h>
5 #include "device-handler.h"
6
7 struct boot_option;
8 struct boot_command;
9
10 typedef void (*boot_status_fn)(void *arg, struct boot_status *);
11
12 struct boot_task *boot(void *ctx, struct discover_boot_option *opt,
13                 struct boot_command *cmd, int dry_run,
14                 boot_status_fn status_fn, void *status_arg);
15
16 void boot_cancel(struct boot_task *task);
17
18 struct boot_task {
19         struct load_url_result *image;
20         struct load_url_result *initrd;
21         struct load_url_result *dtb;
22         const char *local_image;
23         const char *local_initrd;
24         const char *local_dtb;
25         char *local_image_override;
26         char *local_initrd_override;
27         char *local_dtb_override;
28         const char *args;
29         const char *boot_tty;
30         boot_status_fn status_fn;
31         void *status_arg;
32         bool dry_run;
33         bool cancelled;
34         bool verify_signature;
35         struct load_url_result *image_signature;
36         struct load_url_result *initrd_signature;
37         struct load_url_result *dtb_signature;
38         struct load_url_result *cmdline_signature;
39         const char *local_image_signature;
40         const char *local_initrd_signature;
41         const char *local_dtb_signature;
42         const char *local_cmdline_signature;
43 };
44
45 enum {
46         KEXEC_LOAD_SIG_SETUP_INVALID = 253,
47         KEXEC_LOAD_SIGNATURE_FAILURE = 254,
48 };
49
50 #endif /* _BOOT_H */