Hi there!

I need some help with my framework laptop and fedora. I want to switch to linux more permanently, but fedora does not enter hibernation properly when closing the lid. I dont care 10-20sec of wakeup time when opening it again. (even windows is more efficient?!) The relatively bad performance on battery life is OK for me, I already installed TLP instead of the default power management. But when closing the lid, the battery drains about 80% over night (10h?) which seems to be more than what other people reported.

I could not find a guide on this, which i understood (still a massive noob to afraid to mess up my carefully crafted linux partition :D).

If you have any advice I appreciate it! Thanks a lot! :)

  • Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    arrow-up
    1
    ·
    11 months ago

    Framework has a guide for you. You’ll need to disable either power-profiles-daemon or TLP depending on what CPU you have.

    As for hibernation: TL;DR: it’s a mess. Fedora doesn’t support it out of the box. You can make it work with some elbow grease.

    However, you shouldn’t need hibernation if your laptop goes to sleep like it should. If you can’t get it to sleep right, or still really want hibernation, here are some pointers:

    • many Linux distros don’t consider hibernation to be a stable feature. The default Fedora setup doesn’t even come with a swap partition by default, which makes hibernation impossible. You’ll need to allocate some swap space before you can hibernate your computer.
    • make sure your swap partition is encrypted if the rest of your laptop is encrypted as well. If you use a swap file, you can make this work, too, but it’ll be slightly more complicated
    • make sure your swap partition is big enough (at least RAM size + the amount of swap in use at the point of hibernation)
    • if you’re fine with disabling zram and using normal, this guide will show you how to hibernate a normal Linux system: https://www.ctrl.blog/entry/fedora-hibernate.html
    • if you don’t have a partition for swap and don’t want to create one, or if you want to keep using zram (compressed memory, enabled by default on Fedora, probably recommended to keep enabled), then this guide and its comments will tell you how to get a swap file to work. Make sure you read the update with more details too, and there’s also a comment further down specifically about Intel Framework laptops (need to disable a certain Intel driver that breaks hibernation).
    • disable secure boot in your BIOS. Linux doesn’t support the security features that Windows has to validate the state of boot SECURITY (even with custom secure boot keys), so when you’re running in secure boot mode (and the kernel is in lockdown mode), the Linux kernel disables hibernation. Alternatively, there are guides that’ll show you how to patch that check out, but that involves compiling your own kernel and that’s not worth the effort IMO.
    • configure your laptop for suspend-then-hibernate for best performance. I believe hybrid-sleep will also work. The Github gist I linked has details
    • you will probably need to enter your password when resuming from hibernation. This is a security feature. You can configure your laptop to use the TPM to decrypt the disk, skipping the encryption password entirely, it you don’t mind thieves having the ability to access your data when they steal the laptop.

    You may be wondering why this is so complicated. A big reason is that Linux wants to be secure, but hibernation comes with unique security challenges. Linux also wants to be fast and efficient (by compressing RAM rather than writing it to disk) but that messes with the presumptions the hibernation system makes. Fedora dorky sorry hibernation out of the box, but they’re working on it, albeit not as fast as you might hope: https://pagure.io/fedora-workstation/issue/121