Slackware hibernate

May 11, 2007 – 7:14 am by Adnan Hodzic


Offtopic:
When it comes to my life, remember my last post about exam? Linux question, the little disagreement we had? I ended up having 59.25%, 0.75% from 60% and yes I have failed the exam, unbelievable.

Back to topic: Few days ago I just got this urge to get hibernation working, there’s a need to it of course, but it was more to prove myself I could do it from scratch. So I got it working alright, and I’d like to share that cuz there were many “catches” you may want to avoid. I’m sure this lil “WatchOut!” will be helpful to Slackware and Gentoo users, about the rest, I don’t know.

I did this on Slackware 11, vanilla kernel 2.6.20 on Toshiba Satellite with suspend2. First to note that you really cant have a question, unless you patched your kernel before you install hibernate script. So you’ll first download the patch script, and when watch out when getting it, an try to make some sense, in a sense, that you don’t get a patch 2.6.17 and you’re on 2.6.20, there’s just a little note Smile

I went for stable 2.2.9, for 2.6.20, patched my kernel, you’ll do this by:

bzcat /path/to/patch/ | patch –p1

You’ll find it under ACPI, APM in your kernel configuration and I suggest you compile it (*). In your configuration just make sure your “Default resume device name” is not your root partition or anything, but your swap partition.


Suspend2 kernel configuration

Next step is to install your hibernate script (read README if necessary). And if was time for my first hibernate. Just a note that, some of the files were not installed correctly over here, so I had to manually copy them to /etc/hibernate, files like common.conf, hibernate.conf o_O

Ouch! First hibernation, woke the bastard up, no sound, but screw sound, my system was uber slow! Incredibly slow, you’d actually wait for a click to perform, with a lot of disk activity.


#ImageSizeLimit 0

If you take a closer look into your “/etc/hibernate/suspend.conf” you’ll see “#ImageSizeLimit 200” which I put to “#ImageSizeLimit 0” suspended it again, woke it up, hey no more slow downs! However, there was no sound. I let it go for that day and went to sleep. When I was ready to go to sleep, I put my machine to sleep too, to see how it behaves in the morning. After waking it up, I was not happy. System slow down, I asked myself what could it be, and this and that. I first thought it could be my swap, which is set to 1GB, and my physical size is 1GB too, so theoretically it should be 2GB of swap, but I thought it wouldn’t that much, besides that other “physical” 1GB.

However, I did not forget my sound problem. First thought was that my modules wouldn’t load, but then it hit me, how could they load, when they wouldn’t unload in the first place. Would manual “rmmod” help? Yes. But wasn’t that a bit … losing the point of whole hibernation thing, annoying? Unloading all those sound modules before you hibernate, in order to have sound after hibernation? So lsmod-ed, to see what sound modules is my system using at the moment, and I put them all into “/etc/hibernate/blacklisted-modules“, you can see them under “#moja lista


/etc/hibernation/blacklisted-modules

And yes, before I forget, my sound card is a Intel High Definition, which is a real bitch most of the times, with various things.

Hibernate, it wouldnt hibernate, “hibernate -f” would help, but it would force modules to “unload” too. So next time I was actually watching what’s keeping my sound card modules “busy”, it was “kmix” and “amarok”, but after turning those too, it would be artsd, which would turn itself off, after awhile (5-20secs tops).

So what you do? I turned off both amarok and kmix, waited for few secs, “hibernate“. If the script reported that any of modules from the blacklist wouldnt load, you would wait few more secs til it shuts down and that’s it.

So yea, there it goes, no need to force hibernate anymore, and everything would go well. That was a way to get your sound working after hibernation.

Anyhow, after I put it to hibernate over through whole night, it would wake up, and be incredibly slow, just like before setting ImageSizeLimit … crap. I let it sleep through another night or two, and then nothing else was left, but to try the latest “development patch”.

So I did the same thing, normal way of patching wouldn’t work, so I just patched in a way it wouldn’t ask too many questions, that is: “bzcat /path/to/patch/ | patch – p1 -N” but there was a problem to that one. Now, I had two suspend2 in my kernel ACPI, APM, and after configuring the new suspend2, kernel wouldn’t compile.

Blah, so I removed both patches, by “bzcat /path/to/patch/ | patch –p1 -N -R“, and patched my kernel only with the latest development patch 2.2.9.13 for 2.6.20. I’m leaving it it to hibernate two whole nights in a row, and it wakes up perfectly.

So there you go, in a case you get a need for hibernation, Slackware and Gentoo users enjoy Smile You can also configure the looks til it hibernates and all that, but I much more preffer the console look. Seriously Smile


Hibernation


Waking up