Currently using framework 16 with fedora 40 kde plasma. When trying to hibernate after rebooting and setting up the swap file, I get “Call to Hibernate failed: Invalid argument” and running “sudo audit2allow -b” returns nothing. I have double checked my uuid and offset are correct.
TBH I’ve got the same error message and blank output of audit2allow first and disabled selinux completely so I could check if hibernation really works.
So it worked perfectly well and I changed from disabled to permissive in /etc/sysconfig/selinux, rebooted and once again changed mode to enforcing.
I read somewhere in RH documentation so it is advised to toggle to permissive before enforcing so that you don’t have problems booting system up.
After that combination of steps above I tried sudo systemctl hibernate and sudo audit2allow -b and got the output finally. And then retried steps from this guide, but unfortunelly it weirdly kicked me out to the login screen and without hibernation.
After all from gist attached in this post I tried: cd /tmp sudo audit2allow -b -M systemd_sleep sudo semodule -i systemd_sleep.pp
And it worked for me without having to disable selinux
I also have Framework 13/Fedora 40/AMD Ryzen, with gnome
I followed this guide but had some more/different steps.
First, It seems that with systemd 255, there is no more need to set resume and resume_offset in grub.
So from Tarian’s guide, I follow step 1 to 3 then 7 to 11.
At this step, I had the Call to Hibernate failed: Invalid argument message when trying to hibernate.
In journalctl, I had Failed to find location to hibernate to: Invalid argument message.
This is due to /sys/power/resume file containing 0:0 instead of ID of the partition hosting the swapfile.
Mine is on /dev/nvme0n1p3:
root@arcadia:~# ls -l /dev/nvme0n1p3
brw-rw----. 1 root disk 259, 3 11 août 10:11 /dev/nvme0n1p3
Sad to say that this works, but it breaks wifi after resuming from hiberation for me.
It just gives a wifi activation error and nothing resolves it other than restarting the computer
I’ve been able to follow most of the steps here without issue, except that I’m still not able to see any output from audit2allow -b. I updated my /sys/power/resume with the offset value for my /dev/nvme0n1p3 and I added the extra install_items line that underscoreDje mentioned. Finally, I also changed /etc/sysconfig/systemd to SELINUX=permissive and rebooted but still no dice.
The output of journalctl -k contains this message about lockdown:
Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
I do have secure boot enabled, but I’d like to keep it that way since this is a work machine. I know that’s a problem for hibernate after reading through the suggested kernel_lockdown.7 man page, but there’s an old comment in the gist linked in the post which says “there’s an effort to produce signed and verifiable hibernation images”. Since that was about Fedora 37, I was hoping there was some improvement on this situation. However, though I haven’t seen anyone outright say it, I am slowly putting it together that I may not be able to use hibernate at all because of secure boot.
Does that seem to be the case and should stop wasting my time on this?
Hi there
Thanks for the excellent guide. Newbie here (came from Ubuntu) trying to set it up. I am completely lost on the policy, when i try the audit2allow i get no output and when i try $sudo audit2allow -b -M systemd_hibernate
then i get
compilation failed:
systemd_hibernate.te:6:ERROR ‘syntax error’ at token ‘’ on line 6:
thanks for your quick response, sorry the “$” was to show that it was code.
So, let me explain, and sorry for not being very clear. I started by trying to generate the SELinux policy, so i typed
sudo audit2allow -b
the weird thing is the above comes back empty, it returns absolutely nothing.
so i went to /tmp and then i tried
but then what i got was
compilation failed:
systemd_hibernate.te:6:ERROR ‘syntax error’ at token ‘’ on line 6:
/usr/bin/checkmodule: error(s) encountered while parsing configuration
Edit: The below error is because audit2allow will only work if it has already denied an operation.
audit2allow - generate SELinux policy allow/dontaudit rules from logs of denied operations
In this case, the hibernate failure was due to secure boot still being enabled, and so it was not a SELinux policy denial.
I’m encountering the exact same error as @Panos_Sapou. I’m on a Framework 13 with a fresh Fedora 40 install.
Starting from step 11 (after reboot):
miles@fedora:~$ sudo systemctl hibernate
[sudo] password for miles:
Call to Hibernate failed: Sleep verb 'hibernate' is not configured or configuration is not supported by kernel
miles@fedora:~$ sudo audit2allow -b
miles@fedora:~$ cd /tmp
miles@fedora:/tmp$ sudo audit2allow -b -M systemd_hibernate
compilation failed:
systemd_hibernate.te:6:ERROR 'syntax error' at token '' on line 6:
/usr/bin/checkmodule: error(s) encountered while parsing configuration
miles@fedora:/tmp$ cat systemd_hibernate.te
module systemd_hibernate 1.0;
miles@fedora:/tmp$
I achieved the whole tutorial successfully after many attempts, but I got stuck in getting it working. Whenever I call sudo systemctl hibernate, I get a black screen then I spawn in the login screen the following second. What could be happening?
On my side, resuming from hibernation doesn´t work anymore with 6.11.4-201.
It remains stucked on framework splash screen before grub kernel selection menu.
Helpful guide for the newer versions of Fedora. I’ve installed Fedora 40 on ext4 rather than btrfs. I’m trying to get this guide to work with the only change being the use of the following to get the offset value:
With systemd v255 and superior, there is normally no need to set --resume and --resume_offset anymore.
I don´t use this args and hibernate is working.
I use btrfs, but I don´t think the filesystem is relevant here.