LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Slackware, ACPI standby/hibernate howto??? (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/slackware-acpi-standby-hibernate-howto-190191/)

matrixrabbit 06-05-2004 10:26 PM

Slackware, ACPI standby/hibernate howto???
 
Hello! Linux newbie here.. please help!

I have a T30 IBM thinkpad running Kernel 2.6.3 with Slackware 9.1 and fluxbox.
I had ACPI compiled into my kernel when i recompiled from 2.4, and lately i've been reading around to find out how to exactly use ACPI. I'm still quite confused though on how to change the state of my computer (all the S0, S1, S2, etc..) I read a couple threads here and there, and most refer to a file either /sys/proc/state or /proc/acpi/sleep that I need to do some sort of 'echo' command to. Unfortunately, I could find neither (lucky for me). I have known slackware to be a bit...untradtional when it came to finding configuration files, etc... so I went searching around.

My /proc/acpi directory has many subdirectories of the different components of my computer, i figured I had to do something here??:

root@rufus:/proc/acpi# ls -l
total 0
dr-xr-xr-x 3 root root 0 Jun 5 23:12 ac_adapter
dr-xr-xr-x 4 root root 0 Jun 5 23:12 battery
dr-xr-xr-x 5 root root 0 Jun 5 22:54 button
-r-------- 1 root root 0 Jun 5 23:12 dsdt
dr-xr-xr-x 3 root root 0 Jun 5 23:12 embedded_controller
-r-------- 1 root root 0 Jun 5 22:09 event
-r-------- 1 root root 0 Jun 5 23:12 fadt
-r--r--r-- 1 root root 0 Jun 5 23:12 info
dr-xr-xr-x 3 root root 0 Jun 5 23:12 power_resource
dr-xr-xr-x 3 root root 0 Jun 5 23:12 processor
dr-xr-xr-x 3 root root 0 Jun 5 23:12 thermal_zone

so where do I go from here? I also stumbled across the 'sleep' command, then proceeded to experiment with it, but absolutely nothing happens when I type it. So I have still failed to put my computer to sleep. My main questions are: How do I change the state of my computer? If there is a file I need to do some sort of 'echo' command to, any ideas to where slackware would put it? Why doesn't the 'sleep' command do anything to my computer? and if I can even get that far, how then can I map my keys so Fn-F4 (the sleep key-combination in windows) will put my computer to sleep?

ming0 06-06-2004 01:46 PM

I have had luck with 'Software Suspend 2', but to use this, you will need to patch your kernel. Check it out here.

It was a bit difficult for me to figure out how to use the patches, and I recommend using the --dry-run option when you are testing the patches.

The hibernate script on the above site is great for getting your computer all ready to sleep.

Good luck! :)

priller 06-07-2004 05:30 AM

I've had a quick go at getting hibernate to work on a compaq laptop and game up, when it did resume properly ( not very often ) it wasn't any quicker than a normal boot.

Astro 06-07-2004 10:50 AM

I use `apm -s` to suspend my laptop.

ming0 06-07-2004 12:19 PM

Swsusp 2 makes a HUGE difference in boot times for me--and as long as I don't put a pcmcia card in or pull one out during hibernate--it seems to work flawlessly (sound and video both come back perfectly--I can hibernate with an mp3 going and when I unhibernate it will be playing right where it left off).

I shut down in like 5-10 seconds and reboot in about 20 (I'll time it and post the times here after work tonight)

It makes me use my laptop even more now that I can shut it off and turn it on quickly.

matrixrabbit 06-07-2004 04:53 PM

hey, i was going through applying the patches for my kernel for Software Suspend. My kernel version is 2.6.3, but the highest kernel version specific patch was 2.6.2, and i proceeded to use that one, I get numerous messages saying
"Reversed (or previously applied) patch detected! Assume -R? [n]"
What does this mean? should I go ahead and type "yes"?

ming0 06-07-2004 11:30 PM

Go here [sourceforge.net] for the latest patches and test releases.

There is nothing for 2.6.3 or 2.6.4, but you CAN get a patch for 2.6.5 or 2.6.6

I wouldn't recommend using a patch not designed specifically for a kernel version...

So get a new kernel (I'll assume 2.6.6) and download the following--unzip and untar it, and then add the whole and incremental patches (first patch the w/ version specific--then the core):

software-suspend-2.0.0.81-for-2.6.6.tar.bz2

Then install the current (.18) suspend script.

I think this should work... I used the SMP highmem patch for 2.6.5, so I can't guarantee you this is correct. However, you could ask Nigel, the current maintainer of the project, for help if you run into any more trouble. He is VERY good about keeping in touch with people on the swsusp mailing list, and will answer your questions quickly.

Let us know about your progress, and I wish you luck!

--Dean

Oh, and I timed my up and down for hibernating--I may have exaggerated a little :)

from pressing power to fully resumed KDE desktop = 27 seconds

pressing power to fully off = 19 seconds

but it seems to be at least twice as fast as usual...

matrixrabbit 06-08-2004 10:16 AM

wow, thanks guys. it works. I recompiled, added patches, and i now have a /proc/acpi/sleep =).

I do have another question though, when I do suspend to disk (S4 I believe), do I have to have a line added to lilo.conf to tell my computer where ot look for my image? I have heard people having multiple problems with comming back up after full hibernation; result was possible corruption of their data. So just to jump ahead of this so none of my data gets messed up, should I be adding resume2="/dev/hda3"? (hda3 being my swap partition) Or maybe something of the like?

ming0 06-08-2004 12:17 PM

That's what I have I think (in lilo)...

You are going to want to try hibernating make sure you start from a console (like do 'telinit 2') and if you have success, then try from an X11 session.

I almost forgot--if you have any ext3 partitions, you need to install a fsck program. Read the swsusp2's FAQ very carefully--it'll tell you what program you need.

And you know that all you need to do to hibernate is type 'hibernate' right?

matrixrabbit 06-10-2004 12:19 PM

I read through the swsusp FAQ, and determined that the fsck i needed was e2fsprogs, which i have..so that's all good to go. However when I entered in resume2="/dev/hda3" into my lilo, then proceeded to run 'lilo' , I got an error saying "Unrecgonized token "resume2" at or above line 37 in flie '/etc/lilo.conf'.....so er, is that supposed to happen? I tried just "resume" instead of "resume2", but the same error appeared. Should I just ignore this and proceed to try to hibernate? or??
-thanks for all your help so far.

ming0 06-16-2004 02:20 AM

Ok,

Try adding this to the append section... it should look like this:
Code:

append = "resume2=swap:/dev/hda3"
You can add it to your existing append section. (I think it's delimited by commas)

They don't make this very clear in the swsusp2 howto :(

I had the same problem.

I won't be checking this as often, but if you are still trying, I will still try helping :)


All times are GMT -5. The time now is 09:29 AM.