cleanup DUMP_INSTRUCTION handling
let add_dump_code only deal with real dump instruction, move other logic out of that function, so it's easier for future features like kdump_pre and kdump_post. Signed-off-by: Dave Young <dyoung@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
6f312004e9
commit
5d1bd77aed
@ -11,6 +11,8 @@ DUMP_INSTRUCTION=""
|
|||||||
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
|
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
|
||||||
KDUMP_SCRIPT_DIR="/kdumpscripts"
|
KDUMP_SCRIPT_DIR="/kdumpscripts"
|
||||||
DD_BLKSIZE=512
|
DD_BLKSIZE=512
|
||||||
|
FINAL_ACTION="reboot -f"
|
||||||
|
DUMP_RETVAL=0
|
||||||
|
|
||||||
export PATH=$PATH:$KDUMP_SCRIPT_DIR
|
export PATH=$PATH:$KDUMP_SCRIPT_DIR
|
||||||
|
|
||||||
@ -30,7 +32,7 @@ do_default_action()
|
|||||||
|
|
||||||
add_dump_code()
|
add_dump_code()
|
||||||
{
|
{
|
||||||
DUMP_INSTRUCTION="$1 || do_default_action"
|
DUMP_INSTRUCTION=$1
|
||||||
}
|
}
|
||||||
|
|
||||||
get_mp()
|
get_mp()
|
||||||
@ -187,4 +189,10 @@ if [ -z "$DUMP_INSTRUCTION" ]; then
|
|||||||
add_dump_code "dump_rootfs"
|
add_dump_code "dump_rootfs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
eval "$DUMP_INSTRUCTION; reboot -f"
|
$DUMP_INSTRUCTION
|
||||||
|
DUMP_RETVAL=$?
|
||||||
|
if [ $DUMP_RETVAL -ne 0 ]; then
|
||||||
|
do_default_action
|
||||||
|
fi
|
||||||
|
|
||||||
|
$FINAL_ACTION
|
||||||
|
Loading…
Reference in New Issue
Block a user