shared/bootspec: minor simplification
This commit is contained in:
+6
-15
@@ -694,17 +694,12 @@ int boot_entries_load_config_auto(
|
||||
* want to. */
|
||||
|
||||
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);
|
||||
|
||||
if (access("/run/boot-loader-entries/", F_OK) < 0) {
|
||||
if (errno != ENOENT)
|
||||
return log_error_errno(errno, "Failed to determine whether /run/boot-loader-entries/ exists: %m");
|
||||
} else {
|
||||
r = boot_entries_load_config("/run/boot-loader-entries/", NULL, config);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return 0;
|
||||
}
|
||||
if (errno != ENOENT)
|
||||
return log_error_errno(errno,
|
||||
"Failed to determine whether /run/boot-loader-entries/ exists: %m");
|
||||
}
|
||||
|
||||
r = find_esp_and_warn(override_esp_path, false, &esp_where, NULL, NULL, NULL, NULL);
|
||||
@@ -717,11 +712,7 @@ int boot_entries_load_config_auto(
|
||||
if (r < 0 && r != -ENOKEY)
|
||||
return r; /* It's fine if the XBOOTLDR partition doesn't exist, hence we ignore ENOKEY here */
|
||||
|
||||
r = boot_entries_load_config(esp_where, xbootldr_where, config);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return 0;
|
||||
return boot_entries_load_config(esp_where, xbootldr_where, config);
|
||||
}
|
||||
|
||||
int boot_entries_augment_from_loader(BootConfig *config, bool only_auto) {
|
||||
|
||||
Reference in New Issue
Block a user