blob: 23656a18d1c59be9ed71057cf93827dda3fd57a0 (
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
|
post_install() {
# Enable NVIDIA services at first installation
# The services are mandatory, see under systemd configuration
# https://download.nvidia.com/XFree86/Linux-x86_64/570.86.16/README/powermanagement.html#SystemdConfigur74e29
# This is also a requirement to have sleep working together with PreserveAllocations
# https://gitlab.archlinux.org/archlinux/packaging/packages/nvidia-utils/-/commit/55644f78820fd382fbdf283b1fd7f08e6b7c22d7
# https://gitlab.archlinux.org/archlinux/packaging/packages/nvidia-utils/-/merge_requests/16
systemctl enable nvidia-resume nvidia-hibernate nvidia-suspend nvidia-suspend-then-hibernate
}
post_upgrade() {
# Enable services only for versions prior to 570.86.16-1
# This prevents services from being automatically enabled on every update
if (( $(vercmp $2 570.86.16-1) < 0)); then
for service in nvidia-resume nvidia-hibernate nvidia-suspend nvidia-suspend-then-hibernate; do
if ! systemctl is-enabled --quiet $service; then
echo "Enabling $service..."
systemctl enable $service
fi
done
fi
}
pre_remove() {
systemctl disable nvidia-resume nvidia-hibernate nvidia-suspend nvidia-suspend-then-hibernate
}
|