kexec-tools/kexec-Add-option-to-revert-s.patch
Petr Tesařík f3fb4b072a Accepting request 593211 from home:michals
- kexec: add -a option to fall back to KEXEC_LOAD when KEXEC_FILE_LOAD is not
  supported (bsc#1080916, boo#1076839).
  * kexec-Return-ENOSYS-when-kexec-does-not-know-how-to-.patch
  * kexec-Fix-option-checks-to-take-KEXEC_FILE_LOAD-into.patch
  * kexec-Do-not-special-case-the-s-option.patch
  * kexec-Add-option-to-revert-s.patch
  * kexec-Add-option-to-fall-back-to-KEXEC_LOAD-when-KEX.patch
  * kexec-Document-s-c-and-a-options-in-the-man-page.patch
- kexec/ppc64: leverage kexec_file_load support (bsc#1080916)
  * kexec-ppc64-leverage-kexec_file_load-support.patch

Patches accepted upstream.

OBS-URL: https://build.opensuse.org/request/show/593211
OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kexec-tools?expand=0&rev=95
2018-04-05 06:58:41 +00:00

72 lines
2.7 KiB
Diff

From a8639a304b7b62384fc1c747c35eee7728ce583f Mon Sep 17 00:00:00 2001
Message-Id: <a8639a304b7b62384fc1c747c35eee7728ce583f.1522755494.git.msuchanek@suse.de>
In-Reply-To: <e810acd57d9fc2d7ba3b0e95d470c20de9948462.1522755494.git.msuchanek@suse.de>
References: <e810acd57d9fc2d7ba3b0e95d470c20de9948462.1522755494.git.msuchanek@suse.de>
From: Michal Suchanek <msuchanek@suse.de>
Date: Mon, 26 Feb 2018 12:24:44 +0100
Subject: [PATCH v6 4/6] 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>
---
v6: add description to help text
---
kexec/kexec.c | 5 +++++
kexec/kexec.h | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 68ae0594d4a7..87689311af2f 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 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