summarylogtreecommitdiffstats
path: root/nvidia-bl-dkms.install
blob: e78abc007801d88690a916c2047cf7419ecadd7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
post_install() {
  dkms_install $1
}

pre_upgrade() {
  dkms_remove $2
}

post_upgrade() {
  dkms_install $1
}

pre_remove() {
  dkms_remove $1
}

post_remove() {
  echo "Updating module dependencies. Please wait ..."
  depmod $(uname -r)
  echo ""
}

dkms_remove() {

  if [ -n "$(dkms status -m nvidia-bl -v ${1%%-*})" ]; then
    dkms remove -m nvidia-bl -v ${1%%-*} --all || return 1
  fi
}

dkms_install() {
  dkms install -m nvidia-bl -v ${1%%-*} || return 1

  sudo modprobe -r nvidia_bl
  sudo modprobe nvidia_bl
  
  echo ""
  echo "If your backlight is very dim, please check /etc/modprobe.d/nvidia_bl.conf"
  echo ""
}