4 # Source functions library
5 .
/etc
/init.d
/functions
6 .
/usr
/libexec
/ovirt-functions
8 trap '__st=$?; stop_log; exit $__st' 0
9 trap 'exit $?' 1 2 13 15
11 warn
() { printf '%s\n' "$*" >&2; }
14 if ! is_local_storage_configured
; then
15 warn
"Configure local storage before configuring kdump."
19 warn
"Configure network before configuring kdump."
24 function write_kdump_config
{
25 cat > /etc
/kdump.conf
<<EOF
29 ovirt_store_config
/etc
/kdump.conf
33 function kdump_confirm
{
38 printf "\nkdump $server_type Configuration\n"
39 printf "\n$server_type: $server \n\n"
40 if ask_yes_or_no
"Confirm these values ([Y]es/[N]o)?"; then
41 write_kdump_config
$server
42 if [ $server_type = "SSH" ]; then
43 # /dev/console is occupied by firstboot, need to make /dev/tty available
45 ln -s /dev
/console
/dev
/tty
46 service kdump propagate
56 read -p "Enter nfs server path (example.redhat.com:/var/crash): " -er
57 test -z "$REPLY" && return 1
59 kdump_confirm
$nfs_server NFS
66 read -p "Enter ssh user/hostname (root@example.redhat.com): " -er
67 test -z "$REPLY" && return 1
69 kdump_confirm
$ssh_login SSH
72 function restore_config
{
73 cat > /etc
/kdump.conf
<<\EOF
78 ovirt_store_config
/etc
/kdump.conf
82 NFS
="Setup NFS Configuration"
83 SSH
="Setup SSH Configuration"
84 RESTORE
="Restore Default Configuration"
85 QUIT
="Return to the Hypervisor Configuration Menu"
87 if [ "$1" = "AUTO" ]; then
88 if [ -n "$OVIRT_KDUMP_NFS" ]; then
89 write_kdump_config
$OVIRT_KDUMP_NFS
93 printf "\n\n kdump Configuration\n\n"
95 PS3
="Choose an option: "
96 select option
in "$NFS" "$SSH" "$RESTORE" "$QUIT"
100 $NFS) nfs_config
; break;;
101 $SSH) ssh_config
; break;;
102 $RESTORE) restore_config
; break;;