This normalizes naming of functions operating on BootConfig objects.
Let's always call them boot_config_xyz(), like our usual way to name
stuff.
moreover, move the BootConfig parameter to the beginning, as it's not a
return value (which we typically move to the end of the parameter list),
but simply an object, that even happens to be initialized already.
With these changes the functions are more like our usual way to call
things, and less surprises are good.
SD_ID128_FORMAT_VAL(dollar_boot_partition_uuid));
printf("\n\n");
- r = boot_entries_load_config(esp_path, xbootldr_path, &config);
+ r = boot_config_load(&config, esp_path, xbootldr_path);
if (r < 0)
return r;
/* If XBOOTLDR and ESP actually refer to the same block device, suppress XBOOTLDR, since it would find the same entries twice */
bool same = arg_esp_path && arg_xbootldr_path && devid_set_and_equal(esp_devid, xbootldr_devid);
- r = boot_entries_load_config(arg_esp_path, same ? NULL : arg_xbootldr_path, &config);
+ r = boot_config_load(&config, arg_esp_path, same ? NULL : arg_xbootldr_path);
if (r < 0)
return r;
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, /* only_auto= */ false);
+ (void) boot_config_augment_from_loader(&config, efi_entries, /* only_auto= */ false);
r = boot_config_select_special_entries(&config);
if (r < 0)
assert(m);
assert(id);
- r = boot_entries_load_config_auto(NULL, NULL, &config);
+ r = boot_config_load_auto(&config, NULL, NULL);
if (r < 0 && r != -ENOKEY) /* don't complain if no GPT is found, hence skip ENOKEY */
return r;
r = manager_read_efi_boot_loader_entries(m);
if (r >= 0)
- (void) boot_entries_augment_from_loader(&config, m->efi_boot_loader_entries, /* auto_only= */ true);
+ (void) boot_config_augment_from_loader(&config, m->efi_boot_loader_entries, /* auto_only= */ true);
return !!boot_config_find_entry(&config, id);
}
assert(reply);
assert(m);
- r = boot_entries_load_config_auto(NULL, NULL, &config);
+ r = boot_config_load_auto(&config, NULL, NULL);
if (r < 0 && r != -ENOKEY) /* don't complain if there's no GPT found */
return r;
r = manager_read_efi_boot_loader_entries(m);
if (r >= 0)
- (void) boot_entries_augment_from_loader(&config, m->efi_boot_loader_entries, /* auto_only= */ true);
+ (void) boot_config_augment_from_loader(&config, m->efi_boot_loader_entries, /* auto_only= */ true);
r = sd_bus_message_open_container(reply, 'a', "s");
if (r < 0)
return 0;
}
-int boot_entries_load_config(
+int boot_config_load(
+ BootConfig *config,
const char *esp_path,
- const char *xbootldr_path,
- BootConfig *config) {
+ const char *xbootldr_path) {
const char *p;
int r;
return 0;
}
-int boot_entries_load_config_auto(
+int boot_config_load_auto(
+ BootConfig *config,
const char *override_esp_path,
- const char *override_xbootldr_path,
- BootConfig *config) {
+ const char *override_xbootldr_path) {
_cleanup_free_ char *esp_where = NULL, *xbootldr_where = NULL;
dev_t esp_devid = 0, xbootldr_devid = 0;
if (!override_esp_path && !override_xbootldr_path) {
if (access("/run/boot-loader-entries/", F_OK) >= 0)
- return boot_entries_load_config("/run/boot-loader-entries/", NULL, config);
+ return boot_config_load(config, "/run/boot-loader-entries/", NULL);
if (errno != ENOENT)
return log_error_errno(errno,
if (esp_where && xbootldr_where && devid_set_and_equal(esp_devid, xbootldr_devid))
xbootldr_where = mfree(xbootldr_where);
- return boot_entries_load_config(esp_where, xbootldr_where, config);
+ return boot_config_load(config, esp_where, xbootldr_where);
}
-int boot_entries_augment_from_loader(
+int boot_config_augment_from_loader(
BootConfig *config,
char **found_by_loader,
bool only_auto) {
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);
+int boot_config_load(BootConfig *config, const char *esp_path, const char *xbootldr_path);
+int boot_config_load_auto(BootConfig *config, const char *override_esp_path, const char *override_xbootldr_path);
+int boot_config_augment_from_loader(BootConfig *config, char **list, bool only_auto);
int boot_config_select_special_entries(BootConfig *config);
if (access(KEXEC, X_OK) < 0)
return log_error_errno(errno, KEXEC" is not available: %m");
- r = boot_entries_load_config_auto(NULL, NULL, &config);
+ r = boot_config_load_auto(&config, NULL, NULL);
if (r == -ENOKEY)
/* The call doesn't log about ENOKEY, let's do so here. */
return log_error_errno(r,
assert_se(write_string_file(j, entries[i].contents, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_MKDIR_0755) >= 0);
}
- assert_se(boot_entries_load_config(d, NULL, &config) >= 0);
+ assert_se(boot_config_load(&config, d, NULL) >= 0);
assert_se(config.n_entries == 6);