From b192a0d61bfdbdb06ce971dee843973c95fd82e0 Mon Sep 17 00:00:00 2001 From: Amerigo Wang Date: Tue, 2 Aug 2011 18:10:16 +0800 Subject: [PATCH] mkdumprd: fix default action handling --- kdump_dracut_modules/99kdumpbase/kdump.sh | 13 +++++++++---- kexec-tools.spec | 5 ++++- sources | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/kdump_dracut_modules/99kdumpbase/kdump.sh b/kdump_dracut_modules/99kdumpbase/kdump.sh index ba2337c..6869e6a 100755 --- a/kdump_dracut_modules/99kdumpbase/kdump.sh +++ b/kdump_dracut_modules/99kdumpbase/kdump.sh @@ -5,7 +5,7 @@ set -x KDUMP_PATH="/var/crash" CORE_COLLECTOR="makedumpfile -d 31 -c" -DEFAULT_ACTION="reboot -f" +DEFAULT_ACTION="dump_rootfs" DATEDIR=`date +%d.%m.%y-%T` DUMP_INSTRUCTION="" @@ -57,7 +57,12 @@ dump_localfs() { local _dev=`to_dev_name $1` local _mp=`add_to_fstab $_dev` - mount $_mp || return 1 + if [ $_mp = "$NEWROOT/" ] || [ $_mp = "$NEWROOT" ] + then + mount -o remount,rw $_mp || return 1 + else + mount $_mp || return 1 + fi mkdir -p $_mp/$KDUMP_PATH/$DATEDIR $CORE_COLLECTOR /proc/vmcore $_mp/$KDUMP_PATH/$DATEDIR/vmcore || return 1 umount $_mp || return 1 @@ -77,6 +82,7 @@ dump_rootfs() mkdir -p $NEWROOT/$KDUMP_PATH/$DATEDIR $CORE_COLLECTOR /proc/vmcore $NEWROOT/$KDUMP_PATH/$DATEDIR/vmcore || return 1 sync + reboot -f return 0 } @@ -150,10 +156,9 @@ read_kdump_conf if [ -n "$DUMP_INSTRUCTION" ] then - eval "$DUMP_INSTRUCTION" + eval "$DUMP_INSTRUCTION && reboot -f" else dump_rootfs - do_default_action fi diff --git a/kexec-tools.spec b/kexec-tools.spec index 8cb6c40..0690a14 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.2 -Release: 23%{?dist} +Release: 24%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component. @@ -280,6 +280,9 @@ done %changelog +* Tue Aug 2 2011 Cong Wang - 2.0.2-24 +- Fix default action handling. + * Tue Aug 2 2011 Cong Wang - 2.0.2-23 - Install modified kdump.conf in initrd. diff --git a/sources b/sources index 8d4ea21..c33c215 100644 --- a/sources +++ b/sources @@ -2,4 +2,4 @@ d9f2ecd3c3307905f24130a25816e6cc kexec-tools-2.0.0.tar.bz2 3e802d638dce0080b910f15908c04a24 kexec-tools-po.tar.gz e3a813bd6d7dace903a05c1296e20d57 makedumpfile-1.3.5.tar.gz 8e359dd03731b93a2082bd37cc2a4a4c kexec-tools-2.0.2.tar.bz2 -dccb3e4bfa087c2cad6d4eccaa452b66 dracut-files.tbz2 +ee3ecd074481933b8674d4e2163cd2fb dracut-files.tbz2