summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2006-07-25 20:50:14 +0200
committerThomas Bächler <thomas@archlinux.org>2006-07-25 20:50:14 +0200
commit29e9662d0f081782368bb3c92dc12e17277e5738 (patch)
treebda3789c8e60cb2d61db3656fdbaa123510d122d
parentad49fb33613185114bf324caf76dcb833aca6c32 (diff)
downloadmkinitcpio-29e9662d0f081782368bb3c92dc12e17277e5738.tar.gz
mkinitcpio-29e9662d0f081782368bb3c92dc12e17277e5738.tar.xz
added support for suspend2 /sys interface
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@134 880c04e9-e011-0410-abf7-b926e227c9cd
-rw-r--r--hooks/resume15
1 files changed, 12 insertions, 3 deletions
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
}