summarylogtreecommitdiffstats
path: root/nvidia-full-beta-all.install
blob: b84c037f078474eaa5b797931d561a541d021dcd (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
40
41
42
43
44
45
46
47
48
49
50
51
_depmod() {
    _extramodules='extramodules-3.17-ARCH'

    # Update module dependencies for all kernels
    for _kernel in $(cat /usr/lib/modules/extramodules-*/version); do
        depmod $_kernel
    done
}

_rmmod() {
    # Try unloading
    if lsmod | grep -q nvidia; then
        rmmod nvidia
    fi

    # What?
    if [[ $? != 0 ]]; then
        # X running?
        if pidof Xorg >/dev/null; then
            echo ":: Please reboot or exit X first."
        fi
    fi
}

post_install() {
    _depmod

    # X running?
    if pidof Xorg >/dev/null; then
        echo ":: Please reboot or exit X to unload the current module."
    fi

	echo ":: NOTE: You may want to stick to .27: https://devtalk.nvidia.com/default/topic/950647/linux/black-screen-with-367-35/"
}

post_upgrade() {
    _depmod

    # Not rebuilding?
    if (( $(vercmp $1 $2) != 0 )); then
        _rmmod
    fi

	echo ":: NOTE: You might not want to clear Pacman cache from .27: https://devtalk.nvidia.com/default/topic/950647/linux/black-screen-with-367-35/"
}

post_remove() {
    _depmod

    _rmmod
}