summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-03-28 15:15:15 +0200
committerSimon Horman <horms@verge.net.au>2018-03-30 10:44:19 +0200
commit6259b12f5cc80fb90a20da36b6a232a493c6a3f8 (patch)
treed1e5ad4decc613bbae05d95dff9e8dac1c2fdc4a
parent61a03fe9795cafba3fb241da387d7210e482faaa (diff)
downloadkexec-tools-6259b12f5cc80fb90a20da36b6a232a493c6a3f8.tar.gz
kexec: Fix option checks to take KEXEC_FILE_LOAD into account
When kexec_file_load support was added some sanity checks were not updated. Some options are set only in the kexec_load flags so cannot be supported wiht kexec_file_load. On the other hand, reserved memory is needed for kdump with both kexec_load and kexec_file_load. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/kexec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c
index ab8cff7f..b793f31e 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1415,7 +1415,9 @@ int main(int argc, char *argv[])
do_load_jump_back_helper = 0;
}
- if (do_load && (kexec_flags & KEXEC_ON_CRASH) &&
+ if (do_load &&
+ ((kexec_flags & KEXEC_ON_CRASH) ||
+ (kexec_file_flags & KEXEC_FILE_ON_CRASH)) &&
!is_crashkernel_mem_reserved()) {
die("Memory for crashkernel is not reserved\n"
"Please reserve memory by passing"
@@ -1447,6 +1449,12 @@ int main(int argc, char *argv[])
}
}
}
+ if (do_kexec_file_syscall) {
+ if (do_load_jump_back_helper)
+ die("--load-jump-back-helper not supported with kexec_file_load\n");
+ if (kexec_flags & KEXEC_PRESERVE_CONTEXT)
+ die("--load-preserve-context not supported with kexec_file_load\n");
+ }
if (do_reuse_initrd){
check_reuse_initrd();