]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Revert "bootctl: Ignore boot entries (continue #22041)"
authorLennart Poettering <lennart@poettering.net>
Thu, 3 Feb 2022 15:27:33 +0000 (16:27 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 14 Feb 2022 14:44:07 +0000 (15:44 +0100)
src/boot/bootctl.c
src/login/logind-dbus.c
src/shared/bootspec.c
src/shared/bootspec.h

index c76fea0a02403af1c2181a7e38396066c42e449d..edc9ef4be969706d2944fb74ffb9e232fdc59314 100644 (file)
@@ -1606,7 +1606,7 @@ static int verb_list(int argc, char *argv[], void *userdata) {
         else if (r < 0)
                 log_warning_errno(r, "Failed to determine entries reported by boot loader, ignoring: %m");
         else
-                (void) boot_entries_augment_from_loader(&config, efi_entries);
+                (void) boot_entries_augment_from_loader(&config, efi_entries, false);
 
         if (config.n_entries == 0)
                 log_info("No boot loader entries found.");
index e801f2453207ada416cd896fd52a01b35ef46ea8..72de58631a887881507542cc79ebcd5310a74212 100644 (file)
@@ -2923,7 +2923,7 @@ static int boot_loader_entry_exists(Manager *m, const char *id) {
 
         r = manager_read_efi_boot_loader_entries(m);
         if (r >= 0)
-                (void) boot_entries_augment_from_loader(&config, m->efi_boot_loader_entries);
+                (void) boot_entries_augment_from_loader(&config, m->efi_boot_loader_entries, true);
 
         return boot_config_has_entry(&config, id);
 }
@@ -3081,7 +3081,7 @@ static int property_get_boot_loader_entries(
 
         r = manager_read_efi_boot_loader_entries(m);
         if (r >= 0)
-                (void) boot_entries_augment_from_loader(&config, m->efi_boot_loader_entries);
+                (void) boot_entries_augment_from_loader(&config, m->efi_boot_loader_entries, true);
 
         r = sd_bus_message_open_container(reply, 'a', "s");
         if (r < 0)
index 52268f60415bb73910ce424aa348939b3fcdbd89..0076092c2ab4b1115f9c61531e0d5fbeeb445beb 100644 (file)
@@ -759,7 +759,8 @@ int boot_entries_load_config_auto(
 
 int boot_entries_augment_from_loader(
                 BootConfig *config,
-                char **found_by_loader) {
+                char **found_by_loader,
+                bool only_auto) {
 
         static const char *const title_table[] = {
                 /* Pretty names for a few well-known automatically discovered entries. */
@@ -784,12 +785,7 @@ int boot_entries_augment_from_loader(
                 if (boot_config_has_entry(config, *i))
                         continue;
 
-                /*
-                 * consider the 'auto-' entries only, because the others
-                 * ones are detected scanning the 'esp' and 'xbootldr'
-                 * directories by boot_entries_load_config()
-                 */
-                if (!startswith(*i, "auto-"))
+                if (only_auto && !startswith(*i, "auto-"))
                         continue;
 
                 c = strdup(*i);
index 4a95e24e27966853f889f2a915702d4f859aae47..81845f47e37c749c650564a02e113bd738bbc13f 100644 (file)
@@ -76,7 +76,7 @@ static inline BootEntry* boot_config_default_entry(BootConfig *config) {
 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);
+int boot_entries_augment_from_loader(BootConfig *config, char **list, bool only_auto);
 
 static inline const char* boot_entry_title(const BootEntry *entry) {
         return entry->show_title ?: entry->title ?: entry->id;