void-linux / void-linux/void-packages
2 issues in /usr/libexec/elogind/system-sleep/nvidia.sh
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 3.4k
- Forks
- 2.8k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 299
Description
The nvidia package supplies some shell scripts to help with putting the device into sleep mode.
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)"
;;
First, the script ignores the argument completely and always passes hibernate, when it could accept suspend via "$2" as well. I'm not sure if it causes issues, but it looks wrong.
Second thing, the unnecessary sleep for 5 seconds slowing the whole thing down for no reason whatsoever. I just removed that line and nothing broke. ZZZ hook doesn't have the wait time, so I don't think it's doing anything, plus it returns if we succeeded anyway.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading /usr/libexec/elogind/system-sleep/nvidia.sh and compare its sleep hook with the ZZZ hook mentioned in the issue. Confirm how the pre-action argument is passed and whether the five-second wait is needed; done means the hook handles the requested sleep mode and no longer adds the unnecessary delay.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100