[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:slackware_admin:swapfile_hibernation [2012/12/01 13:28 (UTC)] – created fl0 | howtos:slackware_admin:swapfile_hibernation [2012/12/01 14:26 (UTC)] – [Sources] fl0 | ||
---|---|---|---|
Line 32: | Line 32: | ||
| | ||
- | |||
You need to patch the initrd to recognize the resume_offset parameter | You need to patch the initrd to recognize the resume_offset parameter | ||
+ | <file patch init-swapfile.patch> | ||
+ | --- init.orig | ||
+ | +++ init 2012-12-01 14: | ||
+ | @@ -69,6 +69,7 @@ | ||
+ | | ||
+ | | ||
+ | | ||
+ | +RESOFFSET=$(cat / | ||
+ | | ||
+ | | ||
+ | | ||
+ | @@ -269,18 +270,35 @@ | ||
+ | | ||
+ | rmdir /mountkey 2>/ | ||
+ | fi | ||
+ | - | ||
+ | - # Resume state from swap | ||
+ | - if [ " | ||
+ | - if ls -l $RESUMEDEV | grep -q " | ||
+ | - # | ||
+ | - RESUMEDEV=$(readlink -f $RESUMEDEV) | ||
+ | - fi | ||
+ | - echo " | ||
+ | - RESMAJMIN=$(ls -l $RESUMEDEV | tr , : | awk '{ print $5$6 }') | ||
+ | - echo $RESMAJMIN > / | ||
+ | - fi | ||
+ | - | ||
+ | + | ||
+ | +if [ " | ||
+ | + # be lvm aware | ||
+ | + RESUMEDEV=$(readlink -f ${RESUMEDEV} | awk -F '/' | ||
+ | + if [ -r "/ | ||
+ | + # try sysfs | ||
+ | + read RESMAJMIN < "/ | ||
+ | + elif [ -r "/ | ||
+ | + # otherwise run through / | ||
+ | + while read m n b d jnk ; do | ||
+ | + if [ " | ||
+ | + | ||
+ | + break | ||
+ | + fi | ||
+ | + done < "/ | ||
+ | + fi | ||
+ | + if [ -z " | ||
+ | + # Device does not exist (not found in / | ||
+ | + exit 99 | ||
+ | + fi | ||
+ | + | ||
+ | + if [ -n " | ||
+ | + echo "Try resume from ${RESMAJMIN}: | ||
+ | + echo " | ||
+ | + else | ||
+ | + echo " | ||
+ | + fi | ||
+ | +fi | ||
+ | + | ||
+ | </ | ||
mkdir patched_initrd | mkdir patched_initrd | ||
Line 45: | Line 101: | ||
find . -print0 | cpio -ov -0 --format=newc | gzip -9 > / | find . -print0 | cpio -ov -0 --format=newc | gzip -9 > / | ||
- | < | + | < |
image = / | image = / | ||
initrd = / | initrd = / | ||
Line 60: | Line 116: | ||
====== Sources ====== | ====== Sources ====== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | |||
+ | * Originally written by [[wiki: | ||
<!-- If you are copying information from another source, then specify that source --> | <!-- If you are copying information from another source, then specify that source --> |