find-esp: introduce _full() flavour of ESP/XBOOTLDR discovery functions

These functions take so many return paramaters, and in many of our cases
we don't actually needt them. Hence introduce _full() flavours of the
funcs, and hide the params by default.
This commit is contained in:
Lennart Poettering
2026-03-18 10:25:59 +00:00
committed by Luca Boccassi
parent e87303d511
commit 8a2c423870
10 changed files with 69 additions and 41 deletions
+17 -2
View File
@@ -1587,11 +1587,26 @@ int boot_config_load_auto(
"Failed to determine whether /run/boot-loader-entries/ exists: %m");
}
r = find_esp_and_warn(NULL, override_esp_path, /* unprivileged_mode= */ false, &esp_where, NULL, NULL, NULL, NULL, &esp_devid);
r = find_esp_and_warn_full(
/* root= */ NULL,
override_esp_path,
/* unprivileged_mode= */ false,
&esp_where,
/* ret_part= */ NULL,
/* ret_pstart= */ NULL,
/* ret_psize= */ NULL,
/* ret_uuid= */ NULL,
&esp_devid);
if (r < 0) /* we don't log about ENOKEY here, but propagate it, leaving it to the caller to log */
return r;
r = find_xbootldr_and_warn(NULL, override_xbootldr_path, /* unprivileged_mode= */ false, &xbootldr_where, NULL, &xbootldr_devid);
r = find_xbootldr_and_warn_full(
/* root= */ NULL,
override_xbootldr_path,
/* unprivileged_mode= */ false,
&xbootldr_where,
/* ret_uuid= */ NULL,
&xbootldr_devid);
if (r < 0 && r != -ENOKEY)
return r; /* It's fine if the XBOOTLDR partition doesn't exist, hence we ignore ENOKEY here */