893e0b
#!/bin/bash
893e0b
893e0b
. /etc/sysconfig/kdump
893e0b
. /lib/kdump/kdump-lib.sh
893e0b
893e0b
KDUMP_KERNEL=""
893e0b
KDUMP_INITRD=""
893e0b
893e0b
check() {
893e0b
    if [ ! -f /etc/sysconfig/kdump ] || [ ! -f /lib/kdump/kdump-lib.sh ]\
893e0b
        || [ -n "${IN_KDUMP}" ]
893e0b
    then
893e0b
        return 1
893e0b
    fi
893e0b
    return 255
893e0b
}
893e0b
893e0b
depends() {
893e0b
    echo "base shutdown"
893e0b
    return 0
893e0b
}
893e0b
893e0b
prepare_kernel_initrd() {
893e0b
    KDUMP_BOOTDIR=$(check_boot_dir "${KDUMP_BOOTDIR}")
893e0b
    if [ -z "$KDUMP_KERNELVER" ]; then
893e0b
        kdump_kver=`uname -r`
893e0b
    else
893e0b
        kdump_kver=$KDUMP_KERNELVER
893e0b
    fi
893e0b
    KDUMP_KERNEL="${KDUMP_BOOTDIR}/${KDUMP_IMG}-${kdump_kver}${KDUMP_IMG_EXT}"
893e0b
    KDUMP_INITRD="${KDUMP_BOOTDIR}/initramfs-${kdump_kver}kdump.img"
893e0b
}
893e0b
893e0b
install() {
893e0b
    inst_multiple tail find cut dirname hexdump
893e0b
    inst_simple "/etc/sysconfig/kdump"
893e0b
    inst_binary "/usr/sbin/kexec"
893e0b
    inst_binary "/usr/bin/gawk" "/usr/bin/awk"
893e0b
    inst_script "/lib/kdump/kdump-lib.sh" "/lib/kdump-lib.sh"
893e0b
    inst_hook cmdline 00 "$moddir/early-kdump.sh"
893e0b
    prepare_kernel_initrd
893e0b
    inst_binary "$KDUMP_KERNEL"
893e0b
    inst_binary "$KDUMP_INITRD"
893e0b
    chmod -x "${initdir}/$KDUMP_KERNEL"
893e0b
}