summaryrefslogtreecommitdiff
path: root/scripts/local-premount/resume
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2008-04-07 11:51:00 +0200
committermaximilian attems <max@stro.at>2008-04-07 11:51:00 +0200
commitaaf9b600c8ed9055b4e283e6cf1394b6f9f6ac8e (patch)
tree75697af4f5764d2b279b1665c01e6360fdc582cb /scripts/local-premount/resume
parentc1fd9aa6213613fed140da7fe68c67a91f478509 (diff)
downloadinitramfs-tools-aaf9b600c8ed9055b4e283e6cf1394b6f9f6ac8e.tar.gz
initramfs-tools-aaf9b600c8ed9055b4e283e6cf1394b6f9f6ac8e.zip
resume: Add support for resume_offset swap file suspend to disk.
Parse cmdline for resume_offset, export it and pass it to the klibc resume binary. Based on a patch by Alan Jenkins <alan-jenkins@tuffmail.co.uk>. Bonus small codingstyle clean up of local-premount/resume.
Diffstat (limited to 'scripts/local-premount/resume')
-rwxr-xr-xscripts/local-premount/resume12
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume
index d997f81..6bf95e5 100755
--- a/scripts/local-premount/resume
+++ b/scripts/local-premount/resume
@@ -28,11 +28,13 @@ case $resume in
;;
esac
-if [ ! -e "${resume}" ]; then
- exit 0
-fi
+[ ! -e "${resume}" ] && exit 0
+
+[ ! -e /sys/power/resume ] && exit 0
-if [ -e /sys/power/resume ]; then
- # hardcode path, uswsusp ships an resume binary too
+# hardcode path, uswsusp ships an resume binary too
+if [ -n "${resume_offset}" ]; then
+ /bin/resume ${resume} ${resume_offset}
+else
/bin/resume ${resume}
fi