You are not logged in.
Greetings!
I made small bash script to automate setting up hibernation. It is largely based on powerdown functions, but expanded further to do more.
It checks if system can hibernate and if not, adds what is missing. It uses swap partion if one exists, and if not, creates swapfile and uses that. Size can be specified at runtime, but script defaults to 4 gigabytes if no argument is given.
It adds resume hook to mknitcpio.conf if needed, and regenrates initfams.
It also adds necessary kernel parameters to bootloader configuration files, using same identifiers that are used in fstab. Currently grub, refind, systemd-boot and syslinux are supported.
Hibernator also avoids creating swapfiles if rootfilesystem is btrfs, as this could lead to file system corruption. It also backs up all configuration files before editing them.
The script and it's PKGBUILD can be found here: https://github.com/Chrysostomus/hibernator/tree/master
Testing, comments and suggestions are welcome. If you know some bash/awk/sed, you can probably find something to imrove on here, as I really don't know anything about them, and simply emulate skills through google.
Planned features:
- Notify-send events to tell what exactly the script is doing while it is working
- better support for btrfs (currently script refuses to do anything, if root is on btrfs filesystem)
- creating log file
- giving error messages is something goes wrong
- interactive mode?
- option to add kernel parameters even if hibernation is already set (in case bootloader is changed)?
- option to add swapfile even if swap partition exists?
Last edited by Chrysostomus (2015-10-03 03:46:28)
The difference between reality and fiction is that fiction has to make sense.
Offline
I really appreciate if somebody can test this before I try uploading it to aur.
The difference between reality and fiction is that fiction has to make sense.
Offline