1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

bootctl: use boot_config_default_entry() where appropriate

This commit is contained in:
Lennart Poettering 2022-03-24 17:06:16 +01:00
parent f7a7a5e267
commit d412691a91
2 changed files with 4 additions and 1 deletions

View File

@ -723,7 +723,7 @@ static int status_entries(
printf("Default Boot Loader Entry:\n");
r = boot_entry_show(
config.entries + config.default_entry,
boot_config_default_entry(&config),
/* show_as_default= */ false,
/* show_as_selected= */ false,
/* show_discovered= */ false);

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);