Ubuntu – 18.04 hibernate with UEFI and secure boot enabled

18.04hibernatesecure-bootuefi

"sudo systemctl start hibernate.target" worked fine with 16.04 on a Acer B117 using legacy boot; Updating to 18.04 forced me to use UEFI and (Acer requirement) secure boot enabled. Suspend still works, but I need hibernate.

Swap partition is active and equals RAM size + 2GB;

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=myswapuuid"

journalctl -xe revealed failure to access /sys/power/disk

cat /sys/power/disk: [disabled]

cat /sys/power/state: freeze mem

Any suggestions?

Best Answer

I have the same problem and, unfortunately, it's impossible with the official Ubuntu kernel since version 4.13 due to kernel lockdown patchset (efi-lockdown). Substantiation is:

There is currently no way to verify the resume image when returning from hibernate. This might compromise the signed modules trust model, so until we can work with signed hibernate images we disable it when the kernel is locked down.

Related Bionic commit you can see here.

This is a controversial decision and Linus declined to merge these changes to linux kernel.

A bit more details you can find is the article Kernel lockdown in 4.17? and its comments.

So while we wait some magic software, that will work with signed hibernate images, we can only use another kernel or disable secure boot.

P.S. I'll be happy to upvote another answer if somebody solved this problem.