# arg 1: the new package version post_install() { dkms add nvidia/${1%-*} dkms install -m nvidia/${1%-*} echo "==> To build your modules automatically at startup, run:" echo " # systemctl enable dkms" } # arg 1: the new package version # arg 2: the old package versio pre_upgrade() { pre_remove "$2" } # arg 1: the new package version # arg 2: the old package version post_upgrade() { post_install "$1" } # arg 1: the old package version pre_remove() { # Remove modules using dkms [ -n "${1%-*}" ] && dkms remove -m nvidia/${1%-*} --all || true } # vim: ts=2 sw=2 et: