summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-03-01 17:46:58 +0100
committerLennart Poettering <lennart@poettering.net>2019-03-05 16:50:58 +0100
commit78c38fe79c64ea71ffe9bbef9db5f8b17e45b1fd (patch)
treea90953da573d340b9b413e65875956f21e126cb2
parent7800322ca553f62058a9dd57a747f3a637ea8827 (diff)
downloadsystemd-78c38fe79c64ea71ffe9bbef9db5f8b17e45b1fd.tar.gz
systemctl: be careful with boot loader entries lacking a 'linux' line
A boot loader entry might not have a 'linux' line, but an 'efi' line or something else. Let's handle that case nicely.
-rw-r--r--src/systemctl/systemctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 0141e2995d..9be6621809 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3539,6 +3539,9 @@ static int load_kexec_kernel(void) {
if (r < 0)
return r;
+ if (!e->kernel)
+ return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
+ "Boot entry does not refer to Linux kernel, which is not supported currently.");
if (strv_length(e->initrd) > 1)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Boot entry specifies multiple initrds, which is not supported currently.");