I installed PureOS on my x230 using a live USB and everything is going fairly well, except for hibernation. I installed the OS with full disk encryption (except /boot/) and a swap partition, with hibernate. Trouble is, the laptop does not hibernate properly, or at least it does not wake up properly. When I close the lid, it does seem to hibernate - the little quarter moon icon lights up - but when the lid opens up it immediately reboots.
The machine has coreboot installed with a SeaBIOS payload. The only modification in terms of PureOS is that I have an Intel 7265 wifi chip, so I had to install iwlwifi from the Debian repos. Please let me know what further information, if any, I can provide, and thanks for reading!
If doing hibernate by closing the lid, you have to ensure that the lid close event really does associate with hibernation. In other words, until you have this working reliably, hibernate using the command given, rather than by closing the lid. If you get hibernate and resume working reliably then it’s worth verifying whether closing the lid is doing hibernation (rather than, for example, standby).
So I think that the symptoms I’m describing are actually coming from Suspend, not Hibernate. When I try systemctl suspend I get the little moon indicator LED and when I try to wake it up with the power key, it reboots.
systemctl hibernate makes the fan spin up a bunch and then it instantly reboots.
Close the lid, wait 5 minutes, and then open it. When it bootsz open a terminal and enter the command
journalctl > journal.txt
The five minute wait is so you can easily find the reboot amongst the likely-lots of data that will be in journal.txt. see what it says right before that, there may be some useful error messages in there. journal.txt should be in your home folder (or wherever your terminal defaults to when you open it).
Your hardware is missing some firmware is my guess. The behavior you are describing is not normal. PureOS is made to run on Librem laptops, which uses different hardware. Until you get the power management stuff sorted my guess is you will never get anything related to power states functioning.
On my x230 suspend and hibernate are working they way they should. This included all of the LEDs and function keys. I’m however using Ubuntu.
So first I had to figure out make journal logs persist across boots (edit /etc/systemd/journald.conf, uncomment Storage=auto and make it Storage=persistent, by the way).
Here is the moment in the logs when I enter the command systemctl suspend:
Jun 02 06:14:45 serenity sudo[2906]: pam_unix(sudo:session): session closed for user root
Jun 02 06:14:53 serenity polkitd(authority=local)[713]: Registered Authentication Agent for unix-process:2931:155859 (system bus name :1.89 [/usr/bin/pkttyagent --notify-fd 5 --fallback], obj
Jun 02 06:14:53 serenity NetworkManager[689]: <info> [1591092893.4891] manager: sleep: sleep requested (sleeping: no enabled: yes)
Jun 02 06:14:53 serenity NetworkManager[689]: <info> [1591092893.4893] device (eno0): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Jun 02 06:14:53 serenity polkitd(authority=local)[713]: Unregistered Authentication Agent for unix-process:2931:155859 (system bus name :1.89, object path /org/freedesktop/PolicyKit1/Authenti
Jun 02 06:14:53 serenity kernel: e1000e: eno0 NIC Link is Down
Jun 02 06:14:53 serenity NetworkManager[689]: <info> [1591092893.8345] manager: NetworkManager state is now ASLEEP
Jun 02 06:14:54 serenity systemd[1]: Reached target Sleep.
Jun 02 06:14:54 serenity systemd[1]: Starting Restart Syncthing after resume...
Jun 02 06:14:54 serenity systemd[1]: Starting Suspend...
Jun 02 06:14:54 serenity syncthing-start.desktop[1303]: [monitor] 06:14:54 INFO: Signal 1 received; restarting
Jun 02 06:14:54 serenity syncthing-start.desktop[1303]: [BJFJF] 06:14:54 INFO: Disconnected from relay relay://128.173.88.78:22067
Jun 02 06:14:54 serenity syncthing-start.desktop[1303]: [BJFJF] 06:14:54 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
Jun 02 06:14:54 serenity syncthing-start.desktop[1303]: [BJFJF] 06:14:54 INFO: Exiting
Jun 02 06:14:54 serenity systemd[1]: syncthing-resume.service: Succeeded.
Jun 02 06:14:54 serenity systemd[1]: Started Restart Syncthing after resume.
Jun 02 06:14:54 serenity systemd-sleep[2937]: Suspending system...
Jun 02 06:14:54 serenity kernel: PM: suspend entry (deep)
-- Reboot --
I’m not sure how helpful that is.
After I enter the suspend command, the machine goes to sleep, the half moon LED turns on, and the power key starts slow flashing. The machine does not respond to keyboard entry, mouseclicks, or lid openings and closings. It won’t do anything until I press the power button once, at which time it reboots immediately.
One thought is that I could add a resume hook in initramfs.conf? I’m used to arch and editing /etc/mkinitcpio.conf so I suppose the equivalent here is /etc/initramfs-tools/initramfs.conf? But there’s also a hooks directory (currently empty) in /etc/initramfs-tools. Any ideas?
Interesting new development! So systemctl suspend seemingly puts the machine to sleep, and when it tries to wake back up it fails and just reboots.
I just tried systemctl hibernate and something similar, but slightly different happens! The fan spins up and the machine powers itself completely off. No LEDs, no power button glowing. When I press the power button, it turns itself on and boots PureOS. However! It resumes my last session, as if it had just been hibernating! When I log into the desktop it brings up my browser with all tabs still logged-in and everything and the terminal window with my recent history. As if it had been hibernating!
So systemctl hibernate definitely seems to be storing RAM to swap and the machine restores itself to that session upon next log-in. The issue is that it powers itself off between.
Also, when I look at the logs, they don’t go exclusively forward in time? Like there are a bunch of entries for 06:40:18, and then you scroll down and there are a bunch of entries for 06:32:49, and then you scroll down some more and there are more at 06:40:10, and then back to 06:36:11. So there’s some weirdness going on…
Well hibernate is supposed to completely power down the laptop. This is the difference between suspend and hibernate. When you hibernate your battery can be removed and the laptop left for days or months in a closet. However, when you apply power again it will be able to restore your last session thanks to the image stored on your swap.
So if I understood you right, hibernation appears to be working as intended.
I did not realize this was the definition of hibernate. Thanks for enlightening me! So I guess my issue is with suspend.
I’m going to install Ubuntu and see if suspend works properly there, since it is less specialized to Librem equipment. I’ll report back. Thanks for your help!
I’m curious (perhaps its too late now) if your power button is set to reboot on press? I wouldn’t think this should override waking from sleep, but stranger things have happened.
on Gnome 3.36 i don’t even have the option of setting my power-button to be anything else than (1.Suspend, 2.Power-off, 3.Nothing)
it is found in Settings > Power > Suspend & Power Button
i would assume it is related to the fact that there ussually is a dedicated hardware reboot button that is directly wired on the motherboard to the SW-Reset power-switch. this is how it is on most desktop/server machines i imagine but i have had a Dell LAPTOP that had a dedicated Reset button as well.
the power-off button usually does > sudo shutdown -h now
the reset button is something like > sudo shutdown -r now
only the hardware-reset works instantly while the CLI command is a little “slower”
Still have the same problem on Ubuntu. I haven’t tried hibernate yet, partially because Ubuntu’s lame installer made my swap partition only 1 GB rather than 8 GB. Bonus aside: I’m researching how to fix this situation. it seems I have to:
Reduce the size of the root volume by 7G
Increase the size of swap by 7G
So would that be:
lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root vgubuntu -wi-ao---- 165.47g
swap_1 vgubuntu -wi-ao---- 976.00m
# filesystem check; This operation must pass in every 5 steps of file-system check if not there might be some issue with your filesystem.
fsck.ext4 -f /dev/vgubuntu/root
# reduce root filesystem size:
resize2fs -p /dev/vgubuntu/root 7G
# reduce LV size
lvreduce -L 7G /dev/vgubuntu/root
# now do swap
swapoff
lvextend -L+7G /dev/vgubuntu/swap_1
mkswap /dev/vgubuntu/swap_1
swapon /dev/vgubuntu/swap_1
How does that look? After that I’ll try to tackle my wake-from-suspend problem.
I successfully resized my root and swap volumes. For posterity, I booted into an Ubuntu live USB and ran the following commands:
cryptsetup open /dev/sda6 vgubuntu
fsck.ext4 -f /dev/vgubuntu/root
# All 5 passes checked out
lvdisplay
resize2fs -p /dev/vgubuntu/root 158G
lvreduce -L 158G /dev/vgubuntu/root
lvdisplay
lvextend -L+7G /dev/vgubuntu/swap_1
mkswap /dev/vgubuntu/swap_1
# Close the vg before exiting
vgchange -a n vgubuntu
cryptsetup close vgubuntu
et voila! Now systemctl hibernate works great! Time to tackle wake from suspend…