summaryrefslogtreecommitdiffstats
path: root/src/systemctl/systemctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-03-04 18:02:30 +0100
committerLennart Poettering <lennart@poettering.net>2019-03-05 16:50:58 +0100
commit38bd74d67e5d2f2c12b1135ff6872544fe944a3f (patch)
treebcc60f2690577a9becee8f8a868074e15a73637d /src/systemctl/systemctl.c
parentbootspec: rework find_default_boot_entry() to use boot_entries_load_config_au... (diff)
downloadsystemd-38bd74d67e5d2f2c12b1135ff6872544fe944a3f.tar.xz
systemd-38bd74d67e5d2f2c12b1135ff6872544fe944a3f.zip
bootspec: get rid of find_default_boot_entry() entirely
Now only two operations are left. Let's just move this into the caller, since it should make things simpler, clearer and shorter, in particular as there's only a single user for this.
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r--src/systemctl/systemctl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index d88435f8e9..9c67a69c23 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3535,10 +3535,17 @@ static int load_kexec_kernel(void) {
if (access(KEXEC, X_OK) < 0)
return log_error_errno(errno, KEXEC" is not available: %m");
- r = find_default_boot_entry(&config, &e);
+ r = boot_entries_load_config_auto(NULL, NULL, &config);
if (r < 0)
return r;
+ e = boot_config_default_entry(&config);
+ if (!e)
+ return log_error_errno(SYNTHETIC_ERRNO(ENOENT),
+ "No boot loader entry suitable as default, refusing to guess.");
+
+ log_debug("Found default boot loader entry in file \"%s\"", e->path);
+
if (!e->kernel)
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
"Boot entry does not refer to Linux kernel, which is not supported currently.");