post_install() {
  dkms add r8168/${1%-*}
  cat << EOF
==> The module r8168 conflicts with r8169. You can blacklist it with:
==> echo "blacklist r8169" > /etc/modprobe.d/r8169_blacklist.conf
EOF
}

pre_upgrade() {
  pre_remove "$2"
}

post_upgrade() {
  post_install "$1"
}

pre_remove() {
  [ -n "${1%-*}" ] && dkms remove r8168/${1%-*} --all &>/dev/null || true
}
