From: Lennart Poettering Date: Fri, 1 Mar 2019 16:46:58 +0000 (+0100) Subject: systemctl: be careful with boot loader entries lacking a 'linux' line X-Git-Tag: v242-rc1~192^2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78c38fe79c64ea71ffe9bbef9db5f8b17e45b1fd;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 0141e2995de..9be66218090 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.");