lib/efi: Cleanup read/write routines
[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 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         const char *local_image;
20         const char *local_initrd;
21         const char *local_dtb;
22         char *local_image_override;
23         char *local_initrd_override;
24         char *local_dtb_override;
25         const char *args;
26         const char *boot_console;
27         boot_status_fn status_fn;
28         void *status_arg;
29         bool dry_run;
30         bool cancelled;
31         bool verify_signature;
32         bool decrypt_files;
33         const char *local_image_signature;
34         const char *local_initrd_signature;
35         const char *local_dtb_signature;
36         const char *local_cmdline_signature;
37         struct list resources;
38 };
39
40 struct boot_resource {
41         struct load_url_result *result;
42         struct pb_url *url;
43         const char **local_path;
44         const char *name;
45
46         struct list_item list;
47 };
48
49 enum {
50         KEXEC_LOAD_DECRYPTION_FALURE = 252,
51         KEXEC_LOAD_SIG_SETUP_INVALID = 253,
52         KEXEC_LOAD_SIGNATURE_FAILURE = 254,
53 };
54
55 #endif /* _BOOT_H */