bootctl: use boot_config_default_entry() where appropriate

This commit is contained in:
Lennart Poettering
2022-03-28 16:01:54 +02:00
parent f7a7a5e267
commit d412691a91
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -56,6 +56,7 @@ typedef struct BootConfig {
BootEntry *entries;
size_t n_entries;
ssize_t default_entry;
ssize_t selected_entry;
@@ -86,10 +87,12 @@ static inline BootEntry* boot_config_default_entry(BootConfig *config) {
if (config->default_entry < 0)
return NULL;
assert((size_t) config->default_entry < config->n_entries);
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);
int boot_entries_augment_from_loader(BootConfig *config, char **list, bool only_auto);