Re: [PATCH] kdump: Fix for boot problems on SMP

Hariprasad Nellitheertha
2004-11-22T16:36:01Z

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

Akinobu Mita wrote:
> I've forgotten CC-ing.
>
> On Saturday 20 November 2004 10:05, Badari Pulavarty wrote:
>
>
>>4) Load the second kernel to be booted using
>>
>> kexec -p <second-kernel> --args-linux --append="root=<root-dev> dump
>> init 1 memmap=exactmap memmap=640k@0 memmap=32M@16M"
>>
>>But kexec doesn't seem to like option "-p".
>>Even when I removed "-p", its complaining about "--args-linux"

There is a kexec-tools patch that is required to get the "-p" option
working. I had sent it out only to the fastboot mailing list without
updating kdump documentation. I will send out an updated documentation
patch indicating this requirement (I will host the patch on some site
and point to it in the document).

Meanwhile, I am attaching the patch with this note. Kindly try kdump
with this. Thanks!

Regards, Hari

[-- Attachment #2: kexec-tools-panic.patch --]
[-- Type: text/plain, Size: 2402 bytes --]

Signed-off-by: Hariprasad Nellitheertha <hari@in.ibm.com>

---

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 */

_