Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
system hibernates, but never resumes..
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
gbr
n00b
n00b


Joined: 14 Apr 2005
Posts: 29

PostPosted: Thu Jul 28, 2005 1:22 am    Post subject: system hibernates, but never resumes.. Reply with quote

Hi,

I just installed swsusp2 by emerging suspend2-sources. I recompiled the kernel and changed lilo to have a resume2= line.

Now, when I hibernate, the system shuts down clean and fast (from a console, no X yet).

When I turn the system back on, I can't see it even trying to resume. My swap partition is marked as bad (since it has an image in it), but the boot process never seemes to look for it.

I'm running the 2.6.12 suspend kernel, using genkernel to compile it. Which means I have an initramfs, which I'm sure is the culprit.

Any help getting this going would be appreciated.

Gerald
Back to top
View user's profile Send private message
gbr
n00b
n00b


Joined: 14 Apr 2005
Posts: 29

PostPosted: Fri Jul 29, 2005 4:21 am    Post subject: Reply with quote

anyone with some info for me?
Back to top
View user's profile Send private message
Alighieri
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jan 2005
Posts: 88

PostPosted: Sat Jul 30, 2005 8:17 pm    Post subject: Reply with quote

I just figured this out. When you reboot from hibernating, go to the grub menu, select the correct kernel entry (whichever you were using when you hibernated) and hit 'e' for edit. Go to the initrd line and delete it (type 'd'). Go to the kernel line and hit 'e'. Replace "real_root=/dev/hdaX" with "resume2=swap:/dev/hdaY" where Y is your swap partition. If this works, edit your hibernate.conf file in the grub section. Uncomment the line about alternate suspended grub.conf. Make the alternate grub.conf based on your current one, but make the changes above (no initramfs and resume2=swap:/dev/hdaY).

Just noticed that you use lilo. Same idea. Just find a way to add the resume2= bit to your kernel args.
Back to top
View user's profile Send private message
SKBo
n00b
n00b


Joined: 21 Mar 2003
Posts: 24
Location: France

PostPosted: Sat Jul 30, 2005 9:42 pm    Post subject: Reply with quote

There is also a way to keep the initramfs file created by genkernel.
As seen on this part of the Suspend2 howto site, the linuxrc script that is called must have an instruction to resume from a previous hibernation.

This is done by adding "echo > /proc/software_suspend/do_resume" to the /usr/share/genkernel/generic/linuxrc file.
Mine looks like this :
Code:
# Copyright 2003 Gentoo Technologies, Inc.
# Distributed under the GPL

. /etc/initrd.defaults
. /etc/initrd.scripts

splash() {
        return 0
}
[ -e /etc/initrd.splash ] && . /etc/initrd.splash

# Clean input/output
exec >${CONSOLE} <${CONSOLE} 2>&1

if [ "$$" != '1' ]
then
        echo '/linuxrc has to be run as the init process as the one'
        echo 'with a PID of 1. Try adding init="/linuxrc" to the'
        echo 'kernel command line or running "exec /linuxrc".'
        exit 1
fi

mount -o remount,rw /
mount -t proc proc /proc

# Software Suspend 2
echo > /proc/software_suspend/do_resume

(snip)

After the linuxrc file has been modified, you still have to recreate a new initramfs file by hand or using "genkernel initrd" with the options you specified the last time.
Now your initramfs should be used without changing anything on your grub.conf file (except if you didn't specified a swap partition in your kernel, you'll have to set the resume2 arg).
At boot, if a suspend signature is found, it will be used, otherwise it will boot normally.
Back to top
View user's profile Send private message
Alighieri
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jan 2005
Posts: 88

PostPosted: Sun Jul 31, 2005 3:39 pm    Post subject: Reply with quote

Ah, perfect. Except for
Quote:
[Add this] BEFORE the script mounts your filesystem. If the line is missing, your system will not resume. If the line comes after mounting file systems, you will most likely suffer from filesystem corruption. You have been warned.
Shouldn't this come before you remount root? [Or are you remounting the ramfs root?) Also, will this honor the "noresume" kernel arg? I assume this becomes a noop when you did not suspend to disk, right?
Back to top
View user's profile Send private message
SKBo
n00b
n00b


Joined: 21 Mar 2003
Posts: 24
Location: France

PostPosted: Sun Jul 31, 2005 3:45 pm    Post subject: Reply with quote

Alighieri wrote:
Ah, perfect. Except for
Quote:
[Add this] BEFORE the script mounts your filesystem. If the line is missing, your system will not resume. If the line comes after mounting file systems, you will most likely suffer from filesystem corruption. You have been warned.
Shouldn't this come before you remount root? [Or are you remounting the ramfs root?) Also, will this honor the "noresume" kernel arg? Also, I assume this becomes a noop when you did not suspend to disk, right?

You are probably right, / should be mounted read-only, then proc, then software supend should be called depending on the noresume argument, then / should be remounted rw.

I knew I forgot something in my last message: it's a hack :-P
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum