From d9589eab12eb92d0932d5e008e72acabca448b19 Mon Sep 17 00:00:00 2001 From: Ionen Wolkens Date: Sun, 3 Nov 2024 19:17:02 -0500 Subject: [PATCH] x11-drivers/nvidia-drivers: disable >=systemd-256's freeze session Otherwise system may fail to resume from sleep for nvidia users. Have not tried to reproduce myself, but given Debian, Arch, and likely other distros have done this and systemd itself recommends doing with nvidia, let's just do it. Kind of wonder how it took until stable to get a bug report though? Maybe only cause problems for some specific setups, or we have very few ~arch users doing sleep with nvidia. Hopefully doing this here temporary, kind of feel like systemd upstream could handle this better (nvidia does not seem to be the only case where this can cause problems). Signed-off-by: Ionen Wolkens --- ...build => nvidia-drivers-470.256.02-r2.ebuild} | 16 ++++++++++++++++ ...build => nvidia-drivers-535.216.01-r1.ebuild} | 16 ++++++++++++++++ ...build => nvidia-drivers-550.127.05-r1.ebuild} | 16 ++++++++++++++++ ...ebuild => nvidia-drivers-550.40.79-r1.ebuild} | 16 ++++++++++++++++ ...ebuild => nvidia-drivers-565.57.01-r3.ebuild} | 16 ++++++++++++++++ 5 files changed, 80 insertions(+) rename x11-drivers/nvidia-drivers/{nvidia-drivers-470.256.02-r1.ebuild => nvidia-drivers-470.256.02-r2.ebuild} (96%) rename x11-drivers/nvidia-drivers/{nvidia-drivers-535.216.01.ebuild => nvidia-drivers-535.216.01-r1.ebuild} (96%) rename x11-drivers/nvidia-drivers/{nvidia-drivers-550.127.05.ebuild => nvidia-drivers-550.127.05-r1.ebuild} (96%) rename x11-drivers/nvidia-drivers/{nvidia-drivers-550.40.79.ebuild => nvidia-drivers-550.40.79-r1.ebuild} (96%) rename x11-drivers/nvidia-drivers/{nvidia-drivers-565.57.01-r2.ebuild => nvidia-drivers-565.57.01-r3.ebuild} (96%) diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild similarity index 96% rename from x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r1.ebuild rename to x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild index 5245c34c4a82..bc391906f0f4 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r1.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild @@ -374,6 +374,22 @@ documentation that is installed alongside this README." # TODO: cleanup after 255.5 been stable for a few months dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + insinto "${unitdir}"/systemd-homed.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false + EOF + insinto "${unitdir}"/systemd-suspend.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF + dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf + # symlink non-versioned so nvidia-settings can use it even if misdetected dosym nvidia-application-profiles-${PV}-key-documentation \ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.216.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.216.01-r1.ebuild similarity index 96% rename from x11-drivers/nvidia-drivers/nvidia-drivers-535.216.01.ebuild rename to x11-drivers/nvidia-drivers/nvidia-drivers-535.216.01-r1.ebuild index 6b5796fa1b55..f6b99ca641ae 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.216.01.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.216.01-r1.ebuild @@ -438,6 +438,22 @@ documentation that is installed alongside this README." # TODO: cleanup after 255.5 been stable for a few months dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + insinto "${unitdir}"/systemd-homed.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false + EOF + insinto "${unitdir}"/systemd-suspend.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF + dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf + # symlink non-versioned so nvidia-settings can use it even if misdetected dosym nvidia-application-profiles-${PV}-key-documentation \ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05-r1.ebuild similarity index 96% rename from x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05.ebuild rename to x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05-r1.ebuild index 39be92964955..f34ae07f3e62 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05-r1.ebuild @@ -428,6 +428,22 @@ documentation that is installed alongside this README." # TODO: cleanup after 255.5 been stable for a few months dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + insinto "${unitdir}"/systemd-homed.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false + EOF + insinto "${unitdir}"/systemd-suspend.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF + dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf + # symlink non-versioned so nvidia-settings can use it even if misdetected dosym nvidia-application-profiles-${PV}-key-documentation \ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.79.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.79-r1.ebuild similarity index 96% rename from x11-drivers/nvidia-drivers/nvidia-drivers-550.40.79.ebuild rename to x11-drivers/nvidia-drivers/nvidia-drivers-550.40.79-r1.ebuild index a3ac0ff7a563..4434d79b1b3d 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.79.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.79-r1.ebuild @@ -431,6 +431,22 @@ documentation that is installed alongside this README." # TODO: cleanup after 255.5 been stable for a few months dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + insinto "${unitdir}"/systemd-homed.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false + EOF + insinto "${unitdir}"/systemd-suspend.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF + dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf + # symlink non-versioned so nvidia-settings can use it even if misdetected dosym nvidia-application-profiles-${PV}-key-documentation \ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-565.57.01-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-565.57.01-r3.ebuild similarity index 96% rename from x11-drivers/nvidia-drivers/nvidia-drivers-565.57.01-r2.ebuild rename to x11-drivers/nvidia-drivers/nvidia-drivers-565.57.01-r3.ebuild index e665698e0a26..6f2fc8b8718f 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-565.57.01-r2.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-565.57.01-r3.ebuild @@ -438,6 +438,22 @@ documentation that is installed alongside this README." # TODO: cleanup after 255.5 been stable for a few months dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + insinto "${unitdir}"/systemd-homed.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false + EOF + insinto "${unitdir}"/systemd-suspend.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF + dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf + # symlink non-versioned so nvidia-settings can use it even if misdetected dosym nvidia-application-profiles-${PV}-key-documentation \ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation -- 2.47.0