When having suspend2 to page out on a swap device located on an EVMS volume, hibernation (or better: resume) won't work if the initramfs has been built with "genkernel --evms initrd". I identified the reason within /usr/share/genkernel/generic/linuxrc, which does the resume stuff before anything else - and therefore before activating the evms-volumes. Just moving the suspend2-resume stuff near to the end of linuxrc worked great for me. Here's the patch (for genkernel-3.3.11d): --- linuxrc.orig 2006-04-23 11:02:49.000000000 +0200 +++ linuxrc 2006-04-25 10:14:18.000000000 +0200 @@ -25,13 +25,6 @@ mount -o remount,rw / mount -t proc proc /proc -# activate suspend2 -if [ -w /proc/suspend2/do_resume ] -then - echo -e "${GOOD}>>${NORMAL}${BOLD} Activating suspend2 resume..." - echo > /proc/suspend2/do_resume -fi - # Set up symlinks if [ "$0" = '/init' ] then @@ -231,6 +224,14 @@ # Start EVMS startVolumes +# activate suspend2 +if [ -w /proc/suspend2/do_resume ] +then + echo -e "${GOOD}>>${NORMAL}${BOLD} Activating suspend2 resume..." + echo > /proc/suspend2/do_resume +fi + + # Set up unionfs mkdir -p ${NEW_ROOT} setup_unionfs
Hello, We can improve the suspend2 support with this simple routine, it allows using lzf as a module, and use suspend2ui if available at initramfs overlay. This allow to specify in genkernel.conf lzf module as well. AMODULES_SUSPEND2="lzf" suspend2_resume() { if [ -d /proc/suspend2 ]; then local splash_theme=`cat /proc/cmdline | sed 's/.*splash=/splash=/' | sed 's/ .*//' | sed 's/.*theme://' | sed 's/,.*//'` modules_scan suspend2 if [ -z "${splash_theme}" ]; then if which suspend2ui_text > /dev/null; then echo `which suspend2ui_text` > /proc/suspend2/userui_program fi else ln -s /etc/splash/${splash_theme} /etc/splash/suspend2 echo `which suspend2ui_fbsplash` > /proc/suspend2/userui_program fi echo > /proc/suspend2/do_resume #not available now but will be nice #modules_remove suspend2 fi }
*** Bug 132554 has been marked as a duplicate of this bug. ***
OK. I'm not sure I am following here. Where would the suspend2_resume function be called? After starting the evms volumes? Also, where does the AMODULES_SUSPEND2="lzf" go? It *looks* like it should be MODULES_SUSPEND2="lzf" and go into modules_load for each architecture, but it's a bit ambiguous. The best solution would be to attach a patch to this bug, so there's nothing left to question.
(In reply to comment #3) > Where would the suspend2_resume > function be called? After starting the evms volumes? Yes, since if you call it before, some configurations will not be able to access the swap or the suspend file resides on one of the volumes. > AMODULES_SUSPEND2="lzf" go? It *looks* like it should be > MODULES_SUSPEND2="lzf" and go into modules_load for each architecture, Oh... I did not think that it is required by you... If the user wishes to use lzf as a module he will put: AMODULES_SUSPEND2="lzf" At /etc/genkernel.conf to create a new group for it... No patch is needed! You have added this feature for me in bug#96357. If there is no suspend2 group modules_scan will do nothing, right?
(In reply to comment #4) > Oh... > I did not think that it is required by you... > If the user wishes to use lzf as a module he will put: > AMODULES_SUSPEND2="lzf" > At /etc/genkernel.conf to create a new group for it... No patch is needed! > You have added this feature for me in bug#96357. > > If there is no suspend2 group modules_scan will do nothing, right? So what needs doing? Does a modprobe need adding somewhere or do we just need to document this AMODULES_SUSPEND2 trick for swsusp2+evms? :)
(In reply to comment #5) > So what needs doing? Does a modprobe need adding somewhere Well... If you want to be on the safe side, modify modules_scan to check if the file exist or: MODS=`cat /etc/modules/${1} 2> /dev/null` It would also be great if you unload a group of modules as well... (reverse order...) I can do this if you like. so modules can be unloaded if not required. > or do we just need > to document this AMODULES_SUSPEND2 trick for swsusp2+evms? :) Yes... This will be nice!
Could you please provide this as a patch so there is no ambiguity? Thanks...
Sure! Aside of the patch, the user should do the followings: 1. If the lzf was compiled as a module, add the following to genkernel.conf: AMODULES_SUSPEND2="lzf" 2. If the user wishes to use the suspend2-userui, he should create an initramfs overlay with: /sbin/suspend2ui_fbsplash /sbin/suspend2ui_text And run genkernel with appropriate argument.
Created attachment 88853 [details, diff] generic.diff I did not understand why the modules_scan is so complicated, so I did not write modules_remove yet... If you be kind enough to explain why you just don't load all modules in the list I will provide it also. Although for most users having lzf around is OK.
I followed the instructions in comment #8, epatched genkernel-3.3.11d with attachment 88853 [details, diff], and got suspend2-sources-2.6.17-r2 to work with LVM. Many thanx to Alon.
patch works with genkernel-3.4.0-r1 and suspend2-sources-2.6.17-r4.
I've added this to CVS
Created attachment 95090 [details] suspend2_resume This is an update for suspend2_resume routine that supports the upcoming suspend2 version (A move from /proc to /sys) with backward compatibility.
*** Bug 145798 has been marked as a duplicate of this bug. ***
Created attachment 96285 [details] suspend2_resume Fixed to match suspend2-2.2.7.5 sys structure. This supports all versions as well as new ones.
Alright... I've updated this with the latest version of the function.
Fixed in 3.4.1, thanks!