#!/bin/sh

set -e

# Here the module gets built (automatically handled by dh_dkms)

#DEBHELPER#

case $1 in
	(configure)
		# Need to incorporate the DKMS modules into the initramfs so they can
		# override the upstream kernel modules during probe at boot.
		if command -v update-initramfs >/dev/null && \
		   [ -e /etc/initramfs-tools/initramfs.conf ] ; then
			update-initramfs -u
		fi

		# Need to reboot as the upstream modules (or the previous version of
		# this package's modules) have likely been probed at boot.
		if [ -x /usr/share/update-notifier/notify-reboot-required ]; then
			/usr/share/update-notifier/notify-reboot-required
		fi
		;;
esac
