bootctl: unify boot entry loading for "status" and "list"

We must be consistent in the two listings, so let's split out the loading code
and call it from both verb_status() and verb_list(). This effectively makes
verb_status() also call efi_loader_get_entries().

There is still some code duplicated, but that's hard to avoid. Error messages
are made identical for the same errors in various places.

Fixes #22580.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-04-04 21:18:14 +02:00
parent 957b242319
commit 8214758bd5
2 changed files with 53 additions and 42 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ typedef struct BootConfig {
BootEntry* boot_config_find_entry(BootConfig *config, const char *id);
static inline BootEntry* boot_config_default_entry(BootConfig *config) {
static inline const BootEntry* boot_config_default_entry(const BootConfig *config) {
assert(config);
if (config->default_entry < 0)