nvidia: fix sleep for elogind users

This commit is contained in:
Andrew Benson 2024-09-29 15:36:45 -05:00
parent 5ea4636260
commit 804660a4b9
2 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,25 @@
#!/bin/sh
case "$1" in
pre)
logger -t nvidia-sleep "Entering $2 mode (invoked by $SYSTEMD_SLEEP_ACTION)"
/usr/bin/nvidia-sleep.sh "hibernate"
ret=$?
if [ $ret -ne 0 ]; then
logger -t nvidia-sleep "Failed to enter $2 mode (exit code $ret)"
exit $ret
fi
sleep 5
logger -t nvidia-sleep "Entered $2 mode (invoked by $SYSTEMD_SLEEP_ACTION)"
;;
post)
logger -t nvidia-sleep "Exiting $2 mode (invoked by $SYSTEMD_SLEEP_ACTION)"
/usr/bin/nvidia-sleep.sh "resume"
ret=$?
if [ $ret -ne 0 ]; then
logger -t nvidia-sleep "Failed to exit $2 mode (exit code $ret)"
exit $ret
fi
logger -t nvidia-sleep "Exited $2 mode (invoked by $SYSTEMD_SLEEP_ACTION)"
;;
esac

View File

@ -4,7 +4,7 @@ _desc="NVIDIA drivers for linux"
pkgname=nvidia
version=550.120
revision=1
revision=2
maintainer="Andrew Benson <abenson+void@gmail.com>"
license="custom:NVIDIA Proprietary"
homepage="https://www.nvidia.com/en-us/drivers/unix/"
@ -210,6 +210,8 @@ do_install() {
mkdir -p usr/share/dbus-1/system.d
vinstall nvidia-dbus.conf 644 usr/share/dbus-1/system.d
vbin systemd/nvidia-sleep.sh
mkdir -p usr/libexec/elogind/system-sleep
vinstall ${FILESDIR}/nvidia-sleep.sh 0755 usr/libexec/elogind/system-sleep nvidia.sh
# opencl pkg
vinstall nvidia.icd 644 etc/OpenCL/vendors