Skip to content

Commit 2fbf50d

Browse files
committed
bootctl: removed unused parameter only_auto
Remove the parameter 'only_auto' from the function boot_entries_augment_from_loader() because each caller set it always to true. Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
1 parent 9914d89 commit 2fbf50d

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

src/boot/bootctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ static int verb_list(int argc, char *argv[], void *userdata) {
16031603
else if (r < 0)
16041604
log_warning_errno(r, "Failed to determine entries reported by boot loader, ignoring: %m");
16051605
else
1606-
(void) boot_entries_augment_from_loader(&config, efi_entries, true);
1606+
(void) boot_entries_augment_from_loader(&config, efi_entries);
16071607

16081608
if (config.n_entries == 0)
16091609
log_info("No boot loader entries found.");

src/login/logind-dbus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3008,7 +3008,7 @@ static int boot_loader_entry_exists(Manager *m, const char *id) {
30083008

30093009
r = manager_read_efi_boot_loader_entries(m);
30103010
if (r >= 0)
3011-
(void) boot_entries_augment_from_loader(&config, m->efi_boot_loader_entries, true);
3011+
(void) boot_entries_augment_from_loader(&config, m->efi_boot_loader_entries);
30123012

30133013
return boot_config_has_entry(&config, id);
30143014
}
@@ -3166,7 +3166,7 @@ static int property_get_boot_loader_entries(
31663166

31673167
r = manager_read_efi_boot_loader_entries(m);
31683168
if (r >= 0)
3169-
(void) boot_entries_augment_from_loader(&config, m->efi_boot_loader_entries, true);
3169+
(void) boot_entries_augment_from_loader(&config, m->efi_boot_loader_entries);
31703170

31713171
r = sd_bus_message_open_container(reply, 'a', "s");
31723172
if (r < 0)

src/shared/bootspec.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,7 @@ int boot_entries_load_config_auto(
759759

760760
int boot_entries_augment_from_loader(
761761
BootConfig *config,
762-
char **found_by_loader,
763-
bool only_auto) {
762+
char **found_by_loader) {
764763

765764
static const char *const title_table[] = {
766765
/* Pretty names for a few well-known automatically discovered entries. */
@@ -785,7 +784,12 @@ int boot_entries_augment_from_loader(
785784
if (boot_config_has_entry(config, *i))
786785
continue;
787786

788-
if (only_auto && !startswith(*i, "auto-"))
787+
/*
788+
* consider the 'auto-' entries only, because the others
789+
* ones are detected scanning the 'esp' and 'xbootldr'
790+
* directories by boot_entries_load_config()
791+
*/
792+
if (!startswith(*i, "auto-"))
789793
continue;
790794

791795
c = strdup(*i);

src/shared/bootspec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static inline BootEntry* boot_config_default_entry(BootConfig *config) {
7676
void boot_config_free(BootConfig *config);
7777
int boot_entries_load_config(const char *esp_path, const char *xbootldr_path, BootConfig *config);
7878
int boot_entries_load_config_auto(const char *override_esp_path, const char *override_xbootldr_path, BootConfig *config);
79-
int boot_entries_augment_from_loader(BootConfig *config, char **list, bool only_auto);
79+
int boot_entries_augment_from_loader(BootConfig *config, char **list);
8080

8181
static inline const char* boot_entry_title(const BootEntry *entry) {
8282
return entry->show_title ?: entry->title ?: entry->id;

0 commit comments

Comments
 (0)