dracut-kdump.sh: add do_dump() and error out if dump vmcore fails

do_dump() takes care of dump procedure. It'll error out if failing to
save vmcore.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
WANG Chao 2013-08-02 14:22:23 +08:00 committed by Baoquan He
parent 0aee2a0072
commit 7f88bc64ac
1 changed files with 15 additions and 1 deletions

View File

@ -28,6 +28,20 @@ MOUNTS=""
export PATH=$PATH:$KDUMP_SCRIPT_DIR
do_dump()
{
local _ret
eval $DUMP_INSTRUCTION
_ret=$?
if [ $_ret -ne 0 ]; then
echo "kdump: saving vmcore failed"
fi
return $_ret
}
do_umount()
{
if [ -n "$MOUNTS" ]; then
@ -309,7 +323,7 @@ if [ $? -ne 0 ]; then
do_final_action
fi
$DUMP_INSTRUCTION
do_dump
DUMP_RETVAL=$?
do_kdump_post $DUMP_RETVAL