#!/bin/sh # # This kdump-tools hook includes kdump sysctl overrides to the # kdump minimal initrd. # # OPTION=VAR is a control provided only by Ubuntu initramfs-tools, # so this is innocuous and harmless on Debian - kept here for # better code sync between Debian and Ubuntu. # shellcheck disable=SC2034 OPTION=KDUMP PREREQ="" prereqs() { echo "$PREREQ" } case $1 in prereqs) prereqs exit 0 ;; esac # In Debian we don't have the fine-tuned control of what hooks to run # based on OPTION=VAR (like Ubuntu). So, we need the folowing check # in order to prevent this hook to run for regular initrds - it should # only be executed for kdump smaller initrd. if [ "${CONFDIR}" != "/var/lib/kdump/initramfs-tools" ]; then exit 0 fi . /usr/share/initramfs-tools/hook-functions KDUMP_SYSCTL_PATH="/etc/kdump/sysctl.conf" # Avoid stopping the initrd generation in case of no sysctl overrides if [ ! -f ${KDUMP_SYSCTL_PATH} ]; then echo "WARNING: kdump-tools hook couldn't find ${KDUMP_SYSCTL_PATH}" exit 0 fi copy_file config ${KDUMP_SYSCTL_PATH}