[PATCH 4/5] kexec: fallback to KEXEC_LOAD when KEXEC_FILE_LOAD is not supported.

Michal Suchánek msuchanek at suse.de
Wed Feb 28 05:05:12 PST 2018


On Mon, 26 Feb 2018 13:00:37 +0100
Michal Suchanek <msuchanek at suse.de> wrote:

> Not all architectures implement KEXEC_FILE_LOAD. However, on some
> archiectures KEXEC_FILE_LOAD is required when secure boot is enabled
> in locked-down mode. Previously users had to select the
> KEXEC_FILE_LOAD syscall with undocumented -s option. However, if they
> did pass the option kexec would fail on architectures that do not
> support it.
> 
> When no option is passed to select one syscall or the other try
> KEXEC_FILE_LOAD and fall back to KEXEC_LOAD when not suported.
> 
> Signed-off-by: Michal Suchanek <msuchanek at suse.de>
> ---
>  kexec/kexec.c | 43 +++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 39 insertions(+), 4 deletions(-)
> 
> diff --git a/kexec/kexec.c b/kexec/kexec.c
> index a95cfb473d6b..14f56e466a95 100644
> --- a/kexec/kexec.c
> +++ b/kexec/kexec.c
> @@ -1243,6 +1243,7 @@ int main(int argc, char *argv[])
>  	int do_unload = 0;
>  	int do_reuse_initrd = 0;
>  	int do_kexec_file_syscall = 0;
>+	int do_kexec_fallback = 1;

do_kexec_file_syscall should be also set to 1 for the fallback to be
the default. Or we need the fallback option to set do_kexec_fallback
separately.

Thanks

Michal



More information about the kexec mailing list