#!/bin/bash -

. /usr/share/volatile/chroot-common.sh

set -x

#remove the old dkms initrd to prevent the "Failed to find casper uuid.conf" error.
rm -f /boot/initrd.img-*.old-dkms

KVER=$(get_project_kver)
KVER_RELEASE_NAME=$(find /lib/modules -type d -name "$KVER*" | sort -r | head -n 1 | awk -F/ '{print $NF}')

depmod -a ${KVER_RELEASE_NAME}
update-initramfs -u -k ${KVER_RELEASE_NAME}
