From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MJQXE-0005LW-Fl for mharc-grub-devel@gnu.org; Wed, 24 Jun 2009 07:21:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJQXC-0005JU-5x for grub-devel@gnu.org; Wed, 24 Jun 2009 07:20:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJQX7-0005Hm-Dj for grub-devel@gnu.org; Wed, 24 Jun 2009 07:20:57 -0400 Received: from [199.232.76.173] (port=43416 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJQX7-0005He-A5 for grub-devel@gnu.org; Wed, 24 Jun 2009 07:20:53 -0400 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:50917) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MJQX6-0005tC-VB for grub-devel@gnu.org; Wed, 24 Jun 2009 07:20:53 -0400 Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 7A7AD381B64 for ; Wed, 24 Jun 2009 07:20:52 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 24 Jun 2009 07:20:51 -0400 X-Sasl-enc: Val4f76op/EZOvuDcNjklJi3dIMdDmfencW06rkO6V7B 1245842452 Received: from tas.localdomain (p54A65C9C.dip.t-dialin.net [84.166.92.156]) by www.fastmail.fm (Postfix) with ESMTPSA id 2B6F02DFCF for ; Wed, 24 Jun 2009 07:20:52 -0400 (EDT) Received: by tas.localdomain (Postfix, from userid 1000) id 45DBB10E06C1; Wed, 24 Jun 2009 13:20:49 +0200 (CEST) Date: Wed, 24 Jun 2009 13:20:49 +0200 From: Michael Vogt To: grub-devel@gnu.org Message-ID: <20090624112049.GU11691@tas> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MAH+hnPXVZWQ5cD/" Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: support for crashkernel= in 10_linux.in X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 11:20:58 -0000 --MAH+hnPXVZWQ5cD/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, in ubuntu we are working on making it easier to capture kernel crashes. The system we use is based around kdump and it works by triggering a kexec of a special crashdump kernel if the regular kernels crashes. In order for this to work the normal kernel needs a additional commandline option "crashkernel=". Attached is a very simple patch that adds this option automatically if kexec and makedumpfile are available. If its not general enough for inclusion into the default grub2, may a mechanism to pass additional kernel commandline paramters via some sort of defaults.d/ directory would be the right apporoach? Then I could just ship a config file in kexec-tools that looks like this: GRUB_LINUX_CMDLINE_EXTRA="$GRUB_LINUX_CMDLINE_EXTRA crashkernel=384M-2G:64M,2G-:128M" Thanks, Michael P.S. I also put the patch in the bugtracker at https://savannah.gnu.org/bugs/?26874 --MAH+hnPXVZWQ5cD/ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="10_crashkernel.patch" diff -Nur -x '*.orig' -x '*~' grub2-1.96+20090611/util/grub.d/10_linux.in grub2-1.96+20090611.new/util/grub.d/10_linux.in --- grub2-1.96+20090611/util/grub.d/10_linux.in 2009-06-24 10:17:45.202761012 +0200 +++ grub2-1.96+20090611.new/util/grub.d/10_linux.in 2009-06-24 10:19:11.198757708 +0200 @@ -43,6 +43,11 @@ LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} fi +# add crashkernel option if we have the requierd tools +if [ -x "/usr/bin/makedumpfile" ] && [ -x "/sbin/kexec" ]; then + GRUB_CMDLINE_EXTRA="$GRUB_CMDLINE_EXTRA crashkernel=384M-2G:64M,2G-:128M" +fi + test_numeric () { local a=$1 @@ -143,7 +148,7 @@ fi linux_entry "${OS}, Linux ${version}" \ - "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} ${GRUB_CMDLINE_EXTRA}" linux_entry "${OS}, Linux ${version} (recovery mode)" \ "single ${GRUB_CMDLINE_LINUX}" --MAH+hnPXVZWQ5cD/--