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