From 29e9662d0f081782368bb3c92dc12e17277e5738 Mon Sep 17 00:00:00 2001 From: Thomas Bächler Date: Tue, 25 Jul 2006 18:50:14 +0000 Subject: added support for suspend2 /sys interface git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@134 880c04e9-e011-0410-abf7-b926e227c9cd --- hooks/resume | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'hooks') diff --git a/hooks/resume b/hooks/resume index a5dee6e..24b9949 100644 --- a/hooks/resume +++ b/hooks/resume @@ -3,12 +3,21 @@ 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 fi - if [ -e "/proc/suspend2" -a "x${resume2}" != "x" ]; then - echo ${resume2} > /proc/suspend2/resume2 - echo "" > /proc/suspend2/do_resume + + # Try resuming with suspend2 + if [ -d "/sys/power/suspend2" ]; then + suspend2root="/sys/power/suspend2" + else + suspend2root="/proc/suspend2" + fi + if [ -d "${suspend2root}" -a "x${resume2}" != "x" ]; then + echo ${resume2} > ${resume2root}/resume2 + echo "" > ${resume2root}/do_resume fi } -- cgit v1.2.3-24-g4f1b