summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-03-28 15:15:17 +0200
committerSimon Horman <horms@verge.net.au>2018-03-30 10:44:52 +0200
commitb58d076a6ed3612840bd7d71c65aa45641d6165a (patch)
tree5dd6e99d10766de5605c4fb594c81848bb489b5b
parentcb434cbe6f401037e448276bb12056d1fdc3dbfc (diff)
downloadkexec-tools-b58d076a6ed3612840bd7d71c65aa45641d6165a.tar.gz
kexec: Add option to revert -s
The undocumented -s option selects KEXEC_FILE_LOAD syscall but there is no option to select KEXEC_LOAD syscall. Add it so -s can be reverted. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/kexec.c5
-rw-r--r--kexec/kexec.h4
2 files changed, 8 insertions, 1 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 68ae0594..87689311 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1005,6 +1005,8 @@ void usage(void)
" preserve context)\n"
" to original kernel.\n"
" -s, --kexec-file-syscall Use file based syscall for kexec operation\n"
+ " -c, --kexec-syscall Use the kexec_load syscall for for compatibility\n"
+ " with systems that don't support -s (default)\n"
" -d, --debug Enable debugging to help spot a failure.\n"
" -S, --status Return 0 if the type (by default crash) is loaded.\n"
"\n"
@@ -1368,6 +1370,9 @@ int main(int argc, char *argv[])
case OPT_KEXEC_FILE_SYSCALL:
do_kexec_file_syscall = 1;
break;
+ case OPT_KEXEC_SYSCALL:
+ do_kexec_file_syscall = 0;
+ break;
case OPT_STATUS:
do_status = 1;
break;
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 26225d2c..9fd0355e 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -219,6 +219,7 @@ extern int file_types;
#define OPT_TYPE 't'
#define OPT_PANIC 'p'
#define OPT_KEXEC_FILE_SYSCALL 's'
+#define OPT_KEXEC_SYSCALL 'c'
#define OPT_STATUS 'S'
#define OPT_MEM_MIN 256
#define OPT_MEM_MAX 257
@@ -246,11 +247,12 @@ extern int file_types;
{ "mem-max", 1, 0, OPT_MEM_MAX }, \
{ "reuseinitrd", 0, 0, OPT_REUSE_INITRD }, \
{ "kexec-file-syscall", 0, 0, OPT_KEXEC_FILE_SYSCALL }, \
+ { "kexec-syscall", 0, 0, OPT_KEXEC_SYSCALL }, \
{ "debug", 0, 0, OPT_DEBUG }, \
{ "status", 0, 0, OPT_STATUS }, \
{ "print-ckr-size", 0, 0, OPT_PRINT_CKR_SIZE }, \
-#define KEXEC_OPT_STR "h?vdfxyluet:psS"
+#define KEXEC_OPT_STR "h?vdfxyluet:pscS"
extern void dbgprint_mem_range(const char *prefix, struct memory_range *mr, int nr_mr);
extern void die(const char *fmt, ...)