#!/bin/bash
echo -e "\nPostinstall hook. Trying to add to kernel."
# DKMS runs this hook BEFORE it regenerates the module index (depmod comes
# last in dkms install). If the distro's in-tree uio_netx.ko was just
# archived away, a stale modules.dep makes modprobe resolve a non-existent
# file; the resulting ENOENT is reported by modprobe with the very
# misleading message "Unknown symbol in module, or unknown parameter
# (see dmesg)". Refresh the index for the running kernel before testing.
depmod -a "$(uname -r)" 2>/dev/null
modprobe -r uio_netx 2>/dev/null
modprobe uio_netx
echo -e "\nBare result of kernel testing (two lines containing uio should appear:\n"
lsmod | grep uio
echo -e "\n\n********* WARNING *********\nthe module has been build and tried to be added to the kernel, see above for success. If not restart might help and/or executing:\nsudo modprobe uio_netx"
