Skip to content

Latest commit

 

History

History
70 lines (52 loc) · 1.99 KB

hibernation.md

File metadata and controls

70 lines (52 loc) · 1.99 KB

How to get hibernate working on ROG Ally with ChimeraOS

Kernel should have this: https://www.phoronix.com/news/LZ4-Linux-Hibernation-v2

Step 1. Resize /home/swapfile

	sudo swapoff /home/swapfile
    sudo dd if=/dev/zero of=/home/swapfile bs=1M count=24576 oflag=append conv=notrunc
    sudo mkswap /home/swapfile
    sudo swapon /home/swapfile

Step 2. Add resume hook to initramfs

	sudo frzr-unlock
    sudo mv /boot/initramfs-linux.img /boot/initramfs-linux-stock.img
    sudo nano /etc/mkinitcpio.conf # add resume after udev in the HOOKS= line
    sudo mkinitcpio -g /boot/initramfs-linux.img

Step 3. Get resume UUID and offset

Get the UUID of the partition and the swapfile offset

lsblk -f # note down the UUID
sudo btrfs inspect-internal map-swapfile -r /home/swapfile # note down the offset

Step 4. Update /boot/loader/entries/frzr.conf

add resume=UUID= and resume_offset= before nowatchdog in the options line:

sudo nano /boot/loader/entries/frzr.conf

Step 5. Workaround for systemd/systemd#15354

sudo systemctl edit systemd-logind.service

add the following under Anything between here and the comment below will become the contents of the drop-in file

[Service]
ProtectHome=read-only

Step 6. (Skip to step 7 if not using handycon) Edit power button behavior

change power_button from SUSPEND to HIBERNATE:

sudo vim /etc/handygccs/handygccs.conf

Step 7. (Skip if using handycon) Edit power button behavior for systemd

change HandlePowerButton to suspend-then-hibernate:

sudo nano /etc/systemd/logind.conf.d/power_off.conf

Additional Notes

setting: HibernateDelaySec=X

in /etc/systemd/sleep.conf

you can configure how much time after sleep it will hibernate given how fast nvmes are, this is the sweet spot. use sleep-then-hibernate with 30 minutes more or less until it hibernates and continue from where we left with much more power in the battery