diff options
author | Thomas Bächler <thomas@archlinux.org> | 2008-03-22 16:46:54 +0100 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2008-03-22 16:46:54 +0100 |
commit | d16f3e4c39708ca0e3380b3458512409546d2568 (patch) | |
tree | 3cead21cf192388ee8a7d71e93d60f38071f02fe | |
parent | 2df29345a23a13fab9c65d91b4d0a8de77936de6 (diff) | |
download | mkinitcpio-d16f3e4c39708ca0e3380b3458512409546d2568.tar.gz mkinitcpio-d16f3e4c39708ca0e3380b3458512409546d2568.tar.xz |
Change resume hook to work with tuxonice0.5.18
-rw-r--r-- | hooks/resume | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/hooks/resume b/hooks/resume index f410051..e4df259 100644 --- a/hooks/resume +++ b/hooks/resume @@ -1,23 +1,18 @@ # vim:set ft=sh: -# TODO encrypted swap partition if resume2 begins with 'swap:' run_hook () { fmtdevice () { echo "${1}:${2}"; } - # Try resuming with swsusp - if [ -e "/sys/power/resume" -a -e "${resume}" ]; then - dev_t=$( /bin/parseblock "${resume}" ) - fmtdevice ${dev_t} > /sys/power/resume + # Try resuming with tuxonice + tuxoniceroot="/sys/power/tuxonice" + if [ -d "${tuxoniceroot}" -a -n "${resume}" ]; then + echo ${resume} > ${tuxoniceroot}/resume + echo > ${tuxoniceroot}/do_resume fi - # Try resuming with suspend2 - if [ -d "/sys/power/suspend2" ]; then - suspend2root="/sys/power/suspend2" - else - suspend2root="/proc/suspend2" - fi - if [ -d "${suspend2root}" -a -n "${resume2}" ]; then - echo ${resume2} > ${suspend2root}/resume2 - echo > ${suspend2root}/do_resume + # Try resuming with vanilla hibernation + if [ -e "/sys/power/resume" -a -n "${resume}" ]; then + eval $(/bin/parseblock "${resume}") + fmtdevice ${BLOCKDEVICE} > /sys/power/resume fi } |