linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suparna Bhattacharya <suparna@in.ibm.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>,
	lkcd-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, fastboot@osdl.org
Subject: Re: [PATCH][WIP] Using kexec for crash dumps in LKCD
Date: Fri, 7 Feb 2003 21:09:28 +0530	[thread overview]
Message-ID: <20030207210928.A3819@in.ibm.com> (raw)
In-Reply-To: <20030206212615.A2733@in.ibm.com>; from suparna@in.ibm.com on Thu, Feb 06, 2003 at 09:26:15PM +0530

I just checked in the changes for kexec based dumping
into lkcd cvs after tagging the earlier code as "linux2559".

Brief Description/Recap from CVS log:
------------------------------------
Initial release of code to implement an option to save dump
in memory and write it out later (CONFIG_CRASH_DUMP_MEMDEV).

In case of a panic dump, if CONFIG_CRASH_DUMP_SOFTBOOT is
enabled and CONFIG_KEXEC is on, this would use Eric Biederman's
kexec implementation to delay the actual writeout of the dump
to disk to happen after a memory preserving reboot of a new
kernel (along the lines of Mission Critical Linux's mcore
implementation). 
-------------------------------------

The first call to lkcd config after a boot would trigger 
the actual writeout to the dump disk/partition. And then 
lkcd save works as usual to copy the dump into /var/log/dump/<n>/

This is still in a somewhat raw/experimental form, made
available for anyone who'd like to play with it early.
To use it you'd need to apply the kexec patches along
with lkcd. I'll try to put out a TODO list soon for
some things that need to be done to stabilize, complete
and simplify this.

The following patches to sbin.lkcd script and the 
sysconfig.dump file should be used with this.
(kexec preloading gets automatically handled 
once you specify the image and kernel command line 
to use).

I've held back on checking in these particular changes 
for now as I wanted to be sure not to break anything 
for 2.4 lkcd users.  

(BTW, is that also why the lkcd script still uses 227 
as the dump device number rather than 221 ?)

Any suggestions on how to handle this best would be
appreciated.

Regards
Suparna

-- 
Suparna Bhattacharya (suparna@in.ibm.com)
Linux Technology Center
IBM Software Labs, India


--- sbin.lkcd	Mon Dec 16 15:52:51 2002
+++ /home/suparna/suparna/ras/dump/sbin.lkcd	Fri Feb  7 19:28:16 2003
@@ -14,6 +14,7 @@
 KERNTYPES=/boot/Kerntypes
 DUMPCONFIG=/sbin/lkcd_config
 DUMPSYSDEVICE=/dev/dump
+KEXEC=/sbin/kexec
 
 ###########################################################################
 # Functions
@@ -65,8 +66,37 @@
 
 	if [ $? -ne 0 ] ; then
 		echo "$DUMPCONFIG failed!" >&2
+		exit 1
+	fi
+
+	# Set things up for kexec based dumping if applicable
+
+	if [ ! -e /proc/sys/kernel/dump/addr ] ; then
+		return
+	fi
+
+	DUMP_ADDR=`cat /proc/sys/kernel/dump/addr`
+
+	if [ $DUMP_ADDR != 0 ] ; then
+		echo "Preloading kernel for kexec based dumping"
+	else
+		return
 	fi
 
+	if [ ! -e "$KEXEC_IMAGE" ] ; then
+		echo "KEXECIMAGE does not exist!" >&2
+		exit 1
+	fi
+
+	# Preload the kernel image to switch to on panic
+	echo $KEXEC -l \
+	--command-line="$KEXEC_CMDLINE crashdump=$DUMP_ADDR" \
+	$KEXEC_IMAGE
+
+	$KEXEC -l \
+	--command-line="$KEXEC_CMDLINE crashdump=$DUMP_ADDR" \
+	$KEXEC_IMAGE
+
 	return
 }
 
@@ -256,7 +286,7 @@
 
 # make sure system dump device exists -- otherwise, make it
 if [ ! -e $DUMPSYSDEVICE ] ; then
-	mknod $DUMPSYSDEVICE c 227 0
+	mknod $DUMPSYSDEVICE c 221 0
 	chmod 644 $DUMPSYSDEVICE
 fi
 
--- sysconfig.dump	Wed Dec  4 15:20:45 2002
+++ /home/suparna/suparna/ras/dump/sysconfig.dump	Fri Feb  7 20:32:39 2003
@@ -117,11 +117,15 @@
 DUMPDEV=/dev/vmdump
 DUMPDIR=/var/log/dump
 DUMP_SAVE=1
-DUMP_LEVEL=8
-DUMP_FLAGS=0x80000000 # disruptive disk dump is default
-DUMP_COMPRESS=0
+DUMP_LEVEL=2
+DUMP_FLAGS=0x80000002 # disruptive disk dump is default
+DUMP_COMPRESS=2
 PANIC_TIMEOUT=5
 
+# Only relevant for dumping via kexec
+KEXEC_IMAGE=/boot/kexec	
+KEXEC_CMDLINE="root=806 console=tty0 console=ttyS0,38400"
+
 # Network dump configuration parameters
 TARGET_HOST=hostname # set this to vaild hostname/IP
 TARGET_PORT=6666

      reply	other threads:[~2003-02-07 15:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-22 11:07 [PATCH][CFT] kexec (rewrite) for 2.5.52 Eric W. Biederman
2002-12-31 14:35 ` Suparna Bhattacharya
2003-01-03 10:37   ` Eric W. Biederman
2003-01-03 12:41     ` Suparna Bhattacharya
2003-01-04 20:34       ` Eric W. Biederman
2003-01-04 22:42       ` Eric W. Biederman
2003-01-06  5:48       ` [PATCH] kexec for 2.5.54 Eric W. Biederman
2003-01-07 22:46         ` Andy Pfiffer
2003-01-07 23:01           ` Dave Hansen
2003-01-07 23:11             ` Martin J. Bligh
2003-01-15 19:43         ` [2.5.58][KEXEC] Success! (using 2.5.54 version + kexec tools 1.8) Andy Pfiffer
2003-01-04  0:32   ` 2.5.54: Re: [PATCH][CFT] kexec (rewrite) for 2.5.52 Andy Pfiffer
2003-01-04 18:56     ` Eric W. Biederman
     [not found]   ` <m11y2w557p.fsf@frodo.biederman.org>
     [not found]     ` <20030204142426.A1950@in.ibm.com>
     [not found]       ` <m1d6m81ttu.fsf@frodo.biederman.org>
2003-02-06 15:56         ` [PATCH][WIP] Using kexec for crash dumps in LKCD Suparna Bhattacharya
2003-02-07 15:39           ` Suparna Bhattacharya [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030207210928.A3819@in.ibm.com \
    --to=suparna@in.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=fastboot@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkcd-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).