--- kexec-tools-2.0.1/debian/kdump.init.d 2011-05-04 14:39:06.000000000 -0600 +++ /etc/init.d/kdump 2011-05-04 15:59:47.508741393 -0600 @@ -15,7 +15,11 @@ . /lib/lsb/init-functions +# source the config file if it exists +test -r /etc/kdump.conf && . /etc/kdump.conf KVER="`uname -r`" +[ -z $KDUMP_KERNEL ] || KVER=$KDUMP_KERNEL + KERNEL_IMAGE="/boot/vmlinuz-$KVER" INITRD="/boot/initrd.img-$KVER" VMCORE="/boot/vmcoreinfo-$KVER" @@ -48,7 +52,7 @@ # Append kdump_needed for initramfs to know what to do, and add # maxcpus=1 to keep things sane. - APPEND="$APPEND kdump_needed maxcpus=1 irqpoll reset_devices" + APPEND="$APPEND kdump_needed=`uname -r` maxcpus=1 irqpoll reset_devices" # --elf32-core-headers is needed for 32-bit systems (ok # for 64-bit ones too). --- kexec-tools-2.0.1/debian/kdump.initramfs 2011-05-04 14:39:06.000000000 -0600 +++ /usr/share/initramfs-tools/scripts/init-bottom/0_kdump 2011-05-04 15:33:19.796620476 -0600 @@ -13,16 +13,27 @@ ;; esac +# Check that this is a kexec kernel. +grep -q kdump_needed /proc/cmdline || exit 0 + +# since KDUMP_NEEDED is not exported via init script +for x in $(cat /proc/cmdline); do + case $x in + kdump_needed=*) + KDUMP_NEEDED="${x#kdump_needed=}" + ;; + esac +done + KVER="`uname -r`" +[ -z $KDUMP_NEEDED ] || KVER=$KDUMP_NEEDED + INFO="$rootmnt/boot/vmcoreinfo-$KVER" CRASHFILE="$rootmnt/var/crash/vmcore" MAKEDUMPFILE="$rootmnt/usr/bin/makedumpfile" LOG="$rootmnt/var/crash/vmcore.log" VMCORE="/proc/vmcore" -# Check that this is a kexec kernel. -grep -q kdump_needed /proc/cmdline || exit 0 - # Make sure makedumpfile assumptions are satisfied. test -e $INFO || exit 0 test -x $MAKEDUMPFILE || exit 0 @@ -38,8 +49,8 @@ # $MAKEDUMPFILE -E -d 31 -i $INFO $VMCORE $CRASHFILE > $LOG 2>&1 || \ rm -f $CRASHFILE - chmod 400 $CRASHFILE +echo dump kernel $KVER >> $LOG mount $rootmnt -o remount,ro reboot