summaryrefslogtreecommitdiff
path: root/src/shared/bootspec.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-03-04 18:02:30 +0100
committerLennart Poettering <lennart@poettering.net>2019-03-05 16:50:58 +0100
commit38bd74d67e5d2f2c12b1135ff6872544fe944a3f (patch)
treebcc60f2690577a9becee8f8a868074e15a73637d /src/shared/bootspec.h
parentb1a877199635cdd340ba3ce3a7725471691d189c (diff)
downloadsystemd-38bd74d67e5d2f2c12b1135ff6872544fe944a3f.tar.gz
bootspec: get rid of find_default_boot_entry() entirely
Now only two operations are left. Let's just move this into the caller, since it should make things simpler, clearer and shorter, in particular as there's only a single user for this.
Diffstat (limited to 'src/shared/bootspec.h')
-rw-r--r--src/shared/bootspec.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h
index b77497085e..45e1fc37c6 100644
--- a/src/shared/bootspec.h
+++ b/src/shared/bootspec.h
@@ -61,6 +61,13 @@ static inline bool boot_config_has_entry(BootConfig *config, const char *id) {
return false;
}
+static inline BootEntry* boot_config_default_entry(BootConfig *config) {
+ if (config->default_entry < 0)
+ return NULL;
+
+ return config->entries + config->default_entry;
+}
+
void boot_config_free(BootConfig *config);
int boot_entries_load_config(const char *esp_path, const char *xbootldr_path, BootConfig *config);
int boot_entries_load_config_auto(const char *override_esp_path, const char *override_xbootldr_path, BootConfig *config);
@@ -73,7 +80,5 @@ static inline const char* boot_entry_title(const BootEntry *entry) {
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_xbootldr_and_warn(const char *path, bool unprivileged_mode, char **ret_path,sd_id128_t *ret_uuid);
-int find_default_boot_entry(BootConfig *config, const BootEntry **e);
-
const char* boot_entry_type_to_string(BootEntryType t) _const_;
BootEntryType boot_entry_type_from_string(const char *s) _pure_;