File lpcie-dkms.install of Package lpcie-dkms
# This is a default template for a post-install scriptlet.
# Uncomment only required functions and remove any functions
# you don't need (and this header).
## arg 1: the new package version
#pre_install() {
# do something here
#}
## arg 1: the new package version
post_install() {
if [ -z "`dkms status -m lpcie -v 1.0.9`" ]; then
echo "Add module source to dkms"
dkms add -m lpcie -v 1.0.9
fi
# If we haven't loaded a tarball, then try building it for the current kernel
if [ `uname -r | grep -c "BOOT"` -eq 0 ] && [ -e /lib/modules/`uname -r`/build/include ]; then
dkms build -m lpcie -v 1.0.9
dkms install -m lpcie -v 1.0.9
elif [ `uname -r | grep -c "BOOT"` -gt 0 ]; then
echo -e ""
echo -e "Module build for the currently running kernel was skipped since you"
echo -e "are running a BOOT variant of the kernel."
else
echo -e ""
echo -e "Module build for the currently running kernel was skipped since the"
echo -e "kernel source for this kernel does not seem to be installed."
fi
exit 0
}
## arg 1: the new package version
## arg 2: the old package version
pre_upgrade() {
pre_remove $2
}
## arg 1: the new package version
## arg 2: the old package version
post_upgrade() {
post_install
}
## arg 1: the old package version
pre_remove() {
dkms_ver=${1%-*}
echo -e
echo -e "Uninstall of lpcie module (version $dkms_ver) beginning:"
dkms remove -m lpcie -v $dkms_ver --all
exit 0
}
## arg 1: the old package version
#post_remove() {
# do something here
#}
# vim:set ts=2 sw=2 et: