From b1a877199635cdd340ba3ce3a7725471691d189c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 4 Mar 2019 17:57:54 +0100 Subject: [PATCH] bootspec: rework find_default_boot_entry() to use boot_entries_load_config_auto() it's pretty much the same code now, hence use it. --- src/shared/bootspec.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index c6aa2c0f8bf..4e73e6d4abf 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -1416,25 +1416,14 @@ int find_default_boot_entry( BootConfig *config, const BootEntry **e) { - _cleanup_free_ char *esp_where = NULL, *xbootldr_where = NULL; int r; assert(config); assert(e); - r = find_esp_and_warn(NULL, false, &esp_where, NULL, NULL, NULL, NULL); - if (r == -ENOKEY) /* find_esp_and_warn() doesn't warn about this case */ - return log_error_errno(r, "Cannot find the ESP partition mount point."); - if (r < 0) /* But it logs about all these cases, hence don't log here again */ - return r; - - r = find_xbootldr_and_warn(NULL, false, &xbootldr_where, NULL); - if (r < 0 && r != -ENOKEY) - return r; - - r = boot_entries_load_config(esp_where, xbootldr_where, config); + r = boot_entries_load_config_auto(NULL, NULL, config); if (r < 0) - return log_error_errno(r, "Failed to load boot loader entries: %m"); + return r; if (config->default_entry < 0) return log_error_errno(SYNTHETIC_ERRNO(ENOENT), -- 2.47.3