[PATCH v4 3/5] kexec: add option to revert -s
Michal Suchanek
msuchanek at suse.de
Tue Mar 6 05:15:54 PST 2018
The undocumented -s option selects KEXEC_FILE_LOAD syscall but there is
no option to select KEXEC_LOAD syscall so add it. It is generally good
idea and in followup patch the default will be changed so it will be
needed to get KEXEC_LOAD functionality.
Signed-off-by: Michal Suchanek <msuchanek at suse.de>
---
kexec/kexec.c | 3 +++
kexec/kexec.h | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 9ea102e1565a..a95cfb473d6b 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1368,6 +1368,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 26225d2c002a..9fd0355eacd0 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, ...)
--
2.13.6
More information about the kexec
mailing list