summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kexec/kexec.86
-rw-r--r--kexec/kexec.c6
-rw-r--r--kexec/kexec.h7
3 files changed, 18 insertions, 1 deletions
diff --git a/kexec/kexec.8 b/kexec/kexec.8
index 179dcf22..b969cea6 100644
--- a/kexec/kexec.8
+++ b/kexec/kexec.8
@@ -139,6 +139,12 @@ in one call.
Open a help file for
.BR kexec .
.TP
+.B \-\-hotplug
+Setup for kernel modification of the elfcorehdr. This option performs
+the steps needed to support kernel updates to the elfcorehdr in the
+presence of hot un/plug and/or on/offline events. This option only
+useful for KEXEC_LOAD syscall.
+.TP
.B \-i\ (\-\-no-checks)
Fast reboot, no memory integrity checks.
.TP
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 1edbd349..d7907488 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -58,6 +58,8 @@
unsigned long long mem_min = 0;
unsigned long long mem_max = ULONG_MAX;
+unsigned long elfcorehdrsz = 0;
+int do_hotplug = 0;
static unsigned long kexec_flags = 0;
/* Flags for kexec file (fd) based syscall */
static unsigned long kexec_file_flags = 0;
@@ -1069,6 +1071,7 @@ void usage(void)
" back to the compatibility syscall when file based\n"
" syscall is not supported or the kernel did not\n"
" understand the image (default)\n"
+ " --hotplug Setup for kernel modification of elfcorehdr.\n"
" -d, --debug Enable debugging to help spot a failure.\n"
" -S, --status Return 1 if the type (by default crash) is loaded,\n"
" 0 if not.\n"
@@ -1579,6 +1582,9 @@ int main(int argc, char *argv[])
case OPT_PRINT_CKR_SIZE:
print_crashkernel_region_size();
return 0;
+ case OPT_HOTPLUG:
+ do_hotplug = 1;
+ break;
default:
break;
}
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 09333896..487f707a 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -232,7 +232,8 @@ extern int file_types;
#define OPT_PRINT_CKR_SIZE 262
#define OPT_LOAD_LIVE_UPDATE 263
#define OPT_EXEC_LIVE_UPDATE 264
-#define OPT_MAX 265
+#define OPT_HOTPLUG 265
+#define OPT_MAX 266
#define KEXEC_OPTIONS \
{ "help", 0, 0, OPT_HELP }, \
{ "version", 0, 0, OPT_VERSION }, \
@@ -259,6 +260,7 @@ extern int file_types;
{ "debug", 0, 0, OPT_DEBUG }, \
{ "status", 0, 0, OPT_STATUS }, \
{ "print-ckr-size", 0, 0, OPT_PRINT_CKR_SIZE }, \
+ { "hotplug", 0, 0, OPT_HOTPLUG }, \
#define KEXEC_OPT_STR "h?vdfixyluet:pscaS"
@@ -297,6 +299,9 @@ extern int ifdown(void);
extern char purgatory[];
extern size_t purgatory_size;
+extern unsigned long elfcorehdrsz;
+extern int do_hotplug;
+
#define BOOTLOADER "kexec"
#define BOOTLOADER_VERSION PACKAGE_VERSION