]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/bootspec.h
Merge pull request #8417 from brauner/2018-03-09/add_bind_mount_fallback_to_private_d...
[thirdparty/systemd.git] / src / shared / bootspec.h
1 /***
2 This file is part of systemd.
3
4 Copyright 2017 Zbigniew Jędrzejewski-Szmek
5 ***/
6
7 #pragma once
8
9 #include <stdlib.h>
10
11 typedef struct BootEntry {
12 char *filename;
13
14 char *title;
15 char *show_title;
16 char *version;
17 char *machine_id;
18 char *architecture;
19 char **options;
20 char *kernel; /* linux is #defined to 1, yikes! */
21 char *efi;
22 char **initrd;
23 char *device_tree;
24 } BootEntry;
25
26 typedef struct BootConfig {
27 char *default_pattern;
28 char *timeout;
29 char *editor;
30 char *auto_entries;
31 char *auto_firmware;
32 char *console_mode;
33
34 char *entry_oneshot;
35 char *entry_default;
36
37 BootEntry *entries;
38 size_t n_entries;
39 ssize_t default_entry;
40 } BootConfig;
41
42 void boot_entry_free(BootEntry *entry);
43 int boot_entry_load(const char *path, BootEntry *entry);
44 int boot_entries_find(const char *dir, BootEntry **entries, size_t *n_entries);
45
46 int boot_loader_read_conf(const char *path, BootConfig *config);
47 void boot_config_free(BootConfig *config);
48 int boot_entries_load_config(const char *esp_path, BootConfig *config);
49
50 static inline const char* boot_entry_title(const BootEntry *entry) {
51 return entry->show_title ?: entry->title ?: entry->filename;
52 }
53
54 int find_esp_and_warn(const char *path, bool unprivileged_mode, char **ret_path, uint32_t *ret_part, uint64_t *ret_pstart, uint64_t *ret_psize, sd_id128_t *ret_uuid);