You are not logged in.
Hello,
All is in the title: I wonder:
- when the system deems the resume successful.
- when the system discards the image on the swap partition, or at least discards the references to it.
More in details:
I use suspend, hibernate and even hybrid. All perfect (out of the box by the way, great Arch !).
When resuming from hibernation or hybrid, the system somehow discards the saved image at some point.
The battery can end up very low: e.g. the system when on hybrid or hibernate on battery low and the battery later ended very very very low on suspend or just powered off with time.
In that case, it may partially resume and lose power in the process.
Until when can it resume from hibernate without loss of data ?
And from hybrid-suspend, until when does it keep the image when waking up ?
Is there any way to change any behavior for that, or is it hard coded in kernel and that's it ?
I tried looking at kernel docs but did not find where for that subject, and I cannot find in the sources where this does (but would be interested to if I can be pointed somewhere precisely).
Thanks in advance !
Offline
Is there any way to change any behavior for that, or is it hard coded in kernel and that's it ?
It's not just the kernel, the initramfs is part of the mechanism, see /usr/lib/initcpio/hooks/resume.
I suppose you could modify that script to check the battery.
EDIT:
quote tags
Last edited by teateawhy (2016-12-29 18:57:05)
Offline
Hello, thanks for th tip.
hooks/resume:
# standard hibernation
if resumedev=$(resolve_device "$resume" "$rootdelay"); then
if [ -e /sys/power/resume ]; then
printf "%d:%d" $(stat -Lc "0x%t 0x%T" "$resumedev") >/sys/power/resume
return 0So if proper parameter is passed, the resume device etc are sent into /sys/power/resume
But there it becomes internal to kernel until userspace is restored I guess ?
Or does it finally hands over to userspace where a piece of script or systemd writes somwhere that it resumed properly ?
Something I could inhibit until I get the desktop back for example ?
Thanks !
Last edited by heliumtt (2016-12-29 19:41:09)
Offline