Update: After a lot of troubleshooting and testing different combinations of my kernel parameters; I conclude that it works a lot better when leaving
pcie_aspm=force (think I got it from an Arch wiki?), and also never resume when docked if the computer was hibernated on battery. This seems to be working even with the
linux-image-generic-lts-xenial kernel. You can check this pastebin with the results and combination that I’ve tested.
To enable hibernate in the menu, create
/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla with the following content:
[Re-enable hibernate by default in upower]
[Re-enable hibernate by default in logind]
[Re-enable hibernate for multiple users by default in logind]
/etc/default/grub and add
RESUME parameter set to your swap partition in
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.enable_fbc=1 i915.enable_rc6=7"
Don’t forget to run
iwlwifi has any dependencies:
$ lsmod | egrep "^iwlwifi"
iwlwifi 196608 1 iwlmvm
Add, in this case,
case "$1" in
Don’t forget to make it executable,
chmod +x /etc/pm/sleep.d/99_wpa_supplicant.
wpa_supplicant on resume and thaw is needed due to bug #1311257.
And lastly, if you have TLP, make sure to restore previous device state on startup:
$ egrep "^RESTORE_" /etc/default/tlp
Note: I had hibernate working perfect, but then I upgraded to
linux-image-generic-lts-xenial which caused KernelOops on every thawn. After reverting back it worked great again. I’m guessing the reason is that the gfx stack (
xserver-xorg-video-intel-xenial etc.) isn’t available in 14.04 (yet?).