[PATCH v6 2/5] kexec: Fix option checks to take KEXEC_FILE_LOAD into account

Michal Suchanek msuchanek at suse.de
Wed Mar 28 06:15:15 PDT 2018


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 at suse.de>
---
Added in v5
---
 kexec/kexec.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/kexec/kexec.c b/kexec/kexec.c
index ab8cff7fe083..b793f31ea501 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();
-- 
2.13.6




More information about the kexec mailing list