summaryrefslogtreecommitdiffstats
path: root/src/shared/bootspec.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-03-23 17:28:44 +0100
committerLennart Poettering <lennart@poettering.net>2022-03-28 16:01:36 +0200
commitf7a7a5e2675fbcf227700e952c053411200d5d15 (patch)
tree73e77f4b9df3a857d7d604e17732a66d13f425f3 /src/shared/bootspec.c
parentbootspec: normalize oom handling in boot_load_efi_entry_pointers() (diff)
downloadsystemd-f7a7a5e2675fbcf227700e952c053411200d5d15.tar.xz
systemd-f7a7a5e2675fbcf227700e952c053411200d5d15.zip
bootspec: assess default/selected entries *after* we augmented entry list with entries from loader
Fixes: #22580
Diffstat (limited to 'src/shared/bootspec.c')
-rw-r--r--src/shared/bootspec.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c
index 52a1612f3d..188ab1d663 100644
--- a/src/shared/bootspec.c
+++ b/src/shared/bootspec.c
@@ -819,6 +819,21 @@ static int boot_load_efi_entry_pointers(BootConfig *config) {
return 1;
}
+int boot_config_select_special_entries(BootConfig *config) {
+ int r;
+
+ assert(config);
+
+ r = boot_load_efi_entry_pointers(config);
+ if (r < 0)
+ return r;
+
+ config->default_entry = boot_entries_select_default(config);
+ config->selected_entry = boot_entries_select_selected(config);
+
+ return 0;
+}
+
int boot_entries_load_config(
const char *esp_path,
const char *xbootldr_path,
@@ -864,13 +879,6 @@ int boot_entries_load_config(
if (r < 0)
return log_error_errno(r, "Failed to uniquify boot entries: %m");
- r = boot_load_efi_entry_pointers(config);
- if (r < 0)
- return r;
-
- config->default_entry = boot_entries_select_default(config);
- config->selected_entry = boot_entries_select_selected(config);
-
return 0;
}