Signed-off-by: Hariprasad Nellitheertha --- kexec-tools-1.95-hari/kexec/kexec.c | 10 +++++++++- kexec-tools-1.95-hari/kexec/kexec.h | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff -puN kexec/kexec.c~kexec-tools-panic kexec/kexec.c --- kexec-tools-1.95/kexec/kexec.c~kexec-tools-panic 2004-10-18 14:27:27.000000000 +0530 +++ kexec-tools-1.95-hari/kexec/kexec.c 2004-10-19 21:00:23.000000000 +0530 @@ -30,6 +30,7 @@ /* local variables */ static struct memory_range *memory_range; static int memory_ranges; +static unsigned long load_flags; int valid_memory_range(struct kexec_segment *segment) { @@ -243,7 +244,7 @@ static int my_load(const char *type, int if (sort_segments(segments, nr_segments) < 0) { return -1; } - result = kexec_load(entry, nr_segments, segments, 0); + result = kexec_load(entry, nr_segments, segments, load_flags); if (result != 0) { /* The load failed, print some debugging information */ fprintf(stderr, "kexec_load failed: %s\n", @@ -325,6 +326,7 @@ void usage(void) " -u, --unload Unload the current kexec target kernel.\n" " -e, --exec Execute a currently loaded kernel.\n" " -t, --type=TYPE Specify the new kernel is of this type.\n" + " -p, --load-panic Load kernel for the reboot on panic case.\n" "\n" "Supported kernel file types and options: \n" ); @@ -393,6 +395,12 @@ int main(int argc, char *argv[]) case OPT_TYPE: type = optarg; break; + case OPT_PANIC: + do_load = 1; + do_exec = 0; + do_shutdown = 0; + load_flags = 1; + break; default: break; } diff -puN kexec/kexec.h~kexec-tools-panic kexec/kexec.h --- kexec-tools-1.95/kexec/kexec.h~kexec-tools-panic 2004-10-18 14:36:23.000000000 +0530 +++ kexec-tools-1.95-hari/kexec/kexec.h 2004-10-20 14:09:46.000000000 +0530 @@ -45,6 +45,7 @@ extern int file_types; #define OPT_LOAD 'l' #define OPT_UNLOAD 'u' #define OPT_TYPE 't' +#define OPT_PANIC 'p' #define OPT_MAX 256 #define KEXEC_OPTIONS \ { "help", 0, 0, OPT_HELP }, \ @@ -54,7 +55,8 @@ extern int file_types; { "load", 0, 0, OPT_LOAD }, \ { "unload", 0, 0, OPT_UNLOAD }, \ { "exec", 0, 0, OPT_EXEC }, \ - { "type", 1, 0, OPT_TYPE }, -#define KEXEC_OPT_STR "hvdfxluet:" + { "type", 1, 0, OPT_TYPE }, \ + { "panic", 0, 0, OPT_PANIC }, +#define KEXEC_OPT_STR "hvdfxluet:p" #endif /* KEXEC_H */ _