nvidia_x11: fix suspend script paths since 470.57.02 (#131838)

nvidia 470.57.02 changed the path of `nvidia-sleep.sh` and systemd
scripts, making `builder.sh` miss them and suspend-to-ram on systems
where `hardware.nvidia.powerManagement.enable = true` is set fail.
This commit is contained in:
André Vitor de Lima Matos 2021-08-02 17:42:47 +00:00 committed by GitHub
parent f73b3543b5
commit 3f4bb8ff5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,11 +46,17 @@ installPhase() {
fi
# Install systemd power management executables
if [ -e systemd/nvidia-sleep.sh ]; then
mv systemd/nvidia-sleep.sh ./
fi
if [ -e nvidia-sleep.sh ]; then
sed -E 's#(PATH=).*#\1"$PATH"#' nvidia-sleep.sh > nvidia-sleep.sh.fixed
install -Dm755 nvidia-sleep.sh.fixed $out/bin/nvidia-sleep.sh
fi
if [ -e systemd/system-sleep/nvidia ]; then
mv systemd/system-sleep/nvidia ./
fi
if [ -e nvidia ]; then
sed -E "s#/usr(/bin/nvidia-sleep.sh)#$out\\1#" nvidia > nvidia.fixed
install -Dm755 nvidia.fixed $out/lib/systemd/system-sleep/nvidia