Bluefin OS hibernation

It seems that Bluefin uses a zram based swap drive. I would like to use a swap partition to enable hibernation. I believe it is possible, but as I’m still unfamiliar to the particulars of a imutable linux distro, and the non-standard system paths, I wanted to check the collective wisdom here.

Hibernation is an important feature to me, and as I am on a Framework 13, I know it works. Just curious if there are any special hitches getting it working on Bluefin?

Edit: as this has been solved, let’s keep this as a running tab for hibernation on Bluefin with a Framework 13 laptop.

I successfully set up hibernation on my Framework 13 in Bluefin/Aurora, but with a swap file rather than a swap partition. Here are my rough notes on what I did:

Disable Secure Boot in the BIOS, then follow the instructions at Setup hibernation on Silverblue / Kionite? - #8 by aaravchen - Fedora Discussion , but with the following adjustments:

  • In step 6, to add kernel parameters for the swapfile, use sudo rpm-ostree kargs --editor instead of sudo grubby --args='...' --update-kernel=ALL (this different way to modify kernel arguments is one of the differences between Fedora Atomic desktops and the non-Atomic Fedora desktops)
  • Afterwards, follow the instructions at Setup hibernation on Silverblue / Kionite? - #20 by lechuck - Fedora Discussion (this SELinux stuff is one of the special hitches of getting things to work on Fedora desktops)

One thing I noticed around one or two months after I set up hibernation is that my laptop started to exhibit an undesirable behavior where the Wi-Fi module stops being able to connect to Wi-Fi networks after waking up from hibernation. I’m not sure why this would happen (but I suspect a problem in the kernel), and I’m curious if you (or anyone else) can reproduce this behavior.

3 Likes

Thank you very much! I will configure this and report back!

If that is working maybe we can introduce that as a just command? Or integrate it directly into the image?
@j0rge

3 Likes

I have it wanting to work. However when I run
sudo systemctl hibernate

the screen goes black for a second and then the login screen comes up. Looking through the journalctl log doesn’t reveal anything to me, as I have no idea what I am looking for.

I did have to manually edited the policy as it had a troubleshoot require in there.

@ethanjli did you have this issue? What did you have to do? It feels like the system wants to hibernate, but the lid switch or something like is triggering it to immediately wake again.

1 Like

I would whole-heartedly welcome anything that brings hibernation back as a default of sorts.

Bluefin, with its bleeding edge slint, seems like the perfect place to champion such a cause!

1 Like

Sorry this is distro-level stuff and Fedora has years of discussions as to why they don’t support it, we’ll likely never support this with our images.

Interesting. Guess I need to go look those reasons up. I have been wondering for years why hibernation just disappeared from Linux distros.

Despite this, thank you very much for all of your and your teams efforts on Bluefin!

1 Like

Oh, actually I did experience something like that when I was setting up hibernation, when I still hadn’t fully reconfigured my SELinux policies correctly. You may need to go through another iteration of the SELinux-related troubleshooting steps in both the first link I posted and the second link I posted. I really don’t understand SELinux, so I was basically fumbling around in the dark with that.

My understanding is that the current implementation of hibernation defeats secure boot (Why does the kernel lockdown prevent hibernation? - Unix & Linux Stack Exchange) - though I’m not sure if that’s the reason for distros to have dropped it, or the reason Fedora won’t support it.

1 Like

It turns out that a second policy seems to be required. I basically redid step 12 like post 20 suggests and named the policy systemd_hiber instead. However, the contents of that policy and the previous systemd_hibernation policy are identical. Only without creating the second policy it didn’t seem to have any affect on hibernation.

Very curious thing. It is now working.

Do you reset this issue by rebooting? Or is this something that happens everytime you resume? Have you tried more than one wifi connection? I’m wondering if the connection authorization is getting bugged due to the state of the system’s up time, compared to the system time. I wonder if you were to disconnect from the wifi connection BEFORE hibernating if this would be a work around?

Yes, after I reboot then the Wi-Fi module works normally until the next hibernation.

I’ve tried plugging in a USB Wi-Fi dongle after resuming from hibernation, and unfortunately it suffers the same problem (KDE says it’s stuck trying to configure the network interface but it fails with an “Authorization supplicant timed out” error message).

I’ve just now tried disconnecting from Wi-Fi networks before hibernating, and (to my great surprise) I am able to connect to networks after resuming! So this is a viable workaround. In fact, this appears to be a viable alternative to rebooting, for making my Wi-Fi module work after I hibernate without disconnecting first. Thanks for the suggestion!

This behavior makes it very plausible to me that maybe hibernation causes the state of past and future wireless network interfaces to be stored and reloaded in some undesirable way that doesn’t happen with sleep mode.

1 Like

I’ve had similar issues with NICs not working after resuming from sleep. Also on KDE, using SUSE and Fedora(?).

With your solution, maybe it’s a network-manager problem?

I read up on it a few months ago. Basically, because a lot of devices won’t be able to hibernate out of the box, they disabled and removed it for everybody. Makes no sense to me to risk data loss on low battery, by default.

It should be easy to allow the user to run a test and if it works, then enable it. :person_shrugging:

Were you able to find a solution for this? I have the same problem. Also, I noticed that, even after manually editing and recompiling the policy, it still shows the troubleshooting stuff if I run audit2allow again.