summaryrefslogtreecommitdiff
path: root/src/shared/bootspec.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/bootspec.h')
-rw-r--r--src/shared/bootspec.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h
index f47c073a46..ed576210fe 100644
--- a/src/shared/bootspec.h
+++ b/src/shared/bootspec.h
@@ -2,11 +2,15 @@
#pragma once
-#include <stdlib.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <sys/types.h>
-typedef struct BootEntry {
- char *filename;
+#include "sd-id128.h"
+typedef struct BootEntry {
+ char *id; /* This is the file basename without extension */
+ char *path; /* This is the full path to the file */
char *title;
char *show_title;
char *version;
@@ -35,16 +39,13 @@ typedef struct BootConfig {
ssize_t default_entry;
} BootConfig;
-void boot_entry_free(BootEntry *entry);
-int boot_entry_load(const char *path, BootEntry *entry);
-int boot_entries_find(const char *dir, BootEntry **entries, size_t *n_entries);
-
-int boot_loader_read_conf(const char *path, BootConfig *config);
void boot_config_free(BootConfig *config);
int boot_entries_load_config(const char *esp_path, BootConfig *config);
static inline const char* boot_entry_title(const BootEntry *entry) {
- return entry->show_title ?: entry->title ?: entry->filename;
+ return entry->show_title ?: entry->title ?: entry->id;
}
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);
+
+int find_default_boot_entry(const char *esp_path, char **esp_where, BootConfig *config, const BootEntry **e);