e97a90
#!/usr/bin/bash
e97a90
e97a90
COMMAND="$1"
e97a90
KERNEL_VERSION="$2"
e97a90
BOOT_DIR_ABS="$3"
e97a90
KERNEL_IMAGE="$4"
e97a90
e97a90
if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
e97a90
    exit 0
e97a90
fi
e97a90
e97a90
if [[ -d "$BOOT_DIR_ABS" ]]; then
e97a90
    KDUMP_INITRD="initrdkdump"
e97a90
else
e97a90
    BOOT_DIR_ABS="/boot"
e97a90
    KDUMP_INITRD="initramfs-${KERNEL_VERSION}kdump.img"
e97a90
fi
e97a90
e97a90
ret=0
e97a90
case "$COMMAND" in
e97a90
    add)
e97a90
        # Do nothing, kdump initramfs is strictly host only
e97a90
        # and managed by kdump service
e97a90
        ;;
e97a90
    remove)
e97a90
        rm -f -- "$BOOT_DIR_ABS/$KDUMP_INITRD"
e97a90
        ret=$?
e97a90
        ;;
e97a90
esac
e97a90
exit $ret