View Full Version : Swsusp (suspend to disk) on FC3 kernel

11th November 2004, 03:46 PM
I'm working on getting suspend to disk to work on my Thinkpad T23 running FC3. First thing I noted after downloading the kernel 2.6.9 SRPM was that swsusp is disabled in the kernel, and APM is enabled. I disabled APM, and enabled swsusp. In this configuration the build fails. I also tried to apply the swsusp patch from sourceforge, but was unable to apply it. This isn't surprising given that FC3 uses a fairly patched kernel rather than a vanilla one.

I'm wondering if anyone has had success with swsusp on FC3, and more importantly, if you did it by modifying the FC3 kernel, or if you had to use the vanilla 2.6.9 from kernel.org.

Thanks in advance!

11th November 2004, 04:21 PM
I want it to work 2 :)

Following topic... ;)

11th November 2004, 06:42 PM
Ok, I'm making some progress.

I started out by commenting out all patch directives in the spec file. After doing this, I could apply the swsusp patch. I'm now putting them back in, 5 at a time, to see which one conflicts with the swsusp patch from sourceforge (swsusp 2.1.4). This is going to take a while, but it will end up with a decisive answer.

Stay tuned...

11th November 2004, 10:07 PM
I've successfully weeded through the permutations of patches included in the fc3 2.6.9 kernel to find what I can leave in place, yet still apply the (currently) latest swsusp 2.1.4 patches. I have *not* yet tried to compile - this is just about making the SRPM spec build a functional source tree.

The list below represents the patches which need to be excluded from the build spec. When I finish updating the spec to automatically apply swsusp 2.1.4, I'll post the file I arrive at, and how to integrate the swsusp code. I'm referring to /usr/src/redhat/SPECS/kernel-2.6.spec in this context:

patch511 Exec shield core
patch512 Option to printk fatal signals, useful for debugging
patch513 The Execshield VA rearrangements
patch520 4G/4G split
patch521 4G/4G split
patch1050 Make /dev/mem a need-to-know function
patch1051 Make /dev/mem a need-to-know function
patch1400 Kexec in preparation for kexec-based dump
patch1500 Various crash dumping patches
patch1510 Various crash dumping patches
patch1520 Various crash dumping patches
patch1530 Various crash dumping patches
patch1540 Various crash dumping patches
patch1550 Various crash dumping patches
patch1560 Various crash dumping patches
patch1570 Various crash dumping patches
patch1580 Various crash dumping patches

12th November 2004, 07:02 PM
Just wanted to add an update... While the above list does allow the swsusp patch apply cleanly, the kernel will not compile in this configuration. I'm beginning to think I should just forget the Fedora patches and work from a vanilla kernel.

It is so frustrating to get Linux integrated into a laptop! Everything is possible, but it takes superhuman effort to get through it all.

12th November 2004, 07:32 PM
We are all hoping that you can pull off the super-human task of getting swsusp working in fedora. That would make it worth downloading FC3 for me... ;)

keep up the good work,


15th November 2004, 04:19 AM
I hate to say it, but it's just not worth this level of effort. It took a lot of time to get the combination of patches that would allow swsusp2 to apply cleanly. It's taking an obscene amount of time to find the combination that allows the kernel to compile. I would be done by now if I had just gone with the kernel.org 2.6.9. I'm really disappointed that Fedora has chosen to omit swsusp from their kernels; It's a critical feature for laptop users, and keeping it away from users is not going to help work out the bugs. I'm giving up on the FC3 kernel tree and moving to a vanilla kernel.

15th November 2004, 06:30 AM
Thanks again cghubble, keep us posted on your progress I don't know about everyone else, but I'm anxiously waiting on this feature before I upgrade.

Keep up the good work,


30th November 2004, 03:50 PM
Wanted to pass along that I can now successfully suspend / resume to both disk and RAM on my Thinkpad T23 / FC3. It really works quite well - feels faster than the equivalent ops on my Win2k partition, and from what I've read the swsusp2 implementation of hibernation is more reliable than the Windows hibernate.

You will need to learn about source RPMs, and you will need to understand how to compile a kernel to get this working. These details are out of scope for this post.

At any rate, here's an overview of how I got it working...

(1) Did a stock workstation install of FC3

(2) Downloaded the FC3 2.6.9 kernel srpm

(3) Follow the instructions here:

This will get you a patched FC3 kernel that does swsusp2. You don't have to tweak the SRPM like I was trying to do earlier. You can remove a lot of clutter from the kernel by removign support for processors you don't have, and things like fiber channel / raid devices that you'd be unlikely to need on a laptop. The less you select, the less you need to wait for kernel compilation, and often, the more memory and stability you obtain.

(4) I was able to use the preemptible kernel (perf boost on my laptop). I also disabled APM and the normal kernel software suspend. ie - I'm only using ACPI and swsusp2.

(5) Make sure /dev/nvram is selected in the kernel!

(6) Don't forget to download the hibernate script. It's critical to making this work.

(7) You may find that even once things are looking good, it's not working. I did every diagnostic I could think of, then found this little gem:


This is the equivalent of "The Fonze" hitting the jukebox with his elbow on Happy Days. For those of you too young to know what I'm talking about, it's just magic. Since performing that piece of voodoo, my laptop has worked every time.

By combining the above with TPB (thinkpad buttons), ACPId, and the IBM-ACPI extensions, I now have 100% of the special hardware functionality that my Thinkpad would normally have in Windows. This of course exlcudes firmware updates.

I couldn't be happier with this configuration... FC3's Gnome/KDE environments are so well polished compared to prior releases, and the hwardware now works 100%. I've been waiting 5 years for this moment. Hopefully the Fedora team will integrate swsusp2 - it's quite a slick piece of engineering.

Hope this helps others - if you can compile a kernel hibernation is now within your reach.

12th December 2004, 03:43 PM
Hi cghubbell,

thanks for your tipps and instructions.

But i have a problem applying the patches to a 2.6.9 681 kernel. "900-dm-low-memory-fix will not apply cleanly. Reverse applied patches [Yn]?" is my error message. When i proceed the last 4 patches are not applied.

I think you a using 667. Anybody here had success with 681?


15th December 2004, 08:40 PM
Would this (http://www.tummy.com/journals/entries/jafo_20041116_124952) or that (http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2004-November/021248.html) help you out?

They seems to got it to work too. One of them even have precompiled kernels

Oh, could I use that on a normal desktop computer?

16th December 2004, 09:01 AM
This is very good news. Having no software suspend is currently one of the only things keeping me from switching entirely to fedora (no 3d acceleration for my ATI card being the other).
Thank you.

16th December 2004, 02:12 PM
@Yanik: You can run this sws also on a normal desktop. I used to do it all the time with FC2. But i had to use xorg Radeon driver with the ATI binary it was not working.

I played around a litte bit more and now my computer is suspending and the resume is starting. But when all data is read it just reboots :( Damn... i hate computers ;)

17th December 2004, 12:32 PM
After some more struggle it's working now :) Works like a charm.

17th December 2004, 11:03 PM
After some more struggle it's working now :) Works like a charm.

great :) but can you share your instruction with us? :) I try to apply patches, but I cannot - maybe because I have 715 kernel?

18th December 2004, 01:09 AM
I followed the instructions at the links provided, and everything compiled without err. However, I can now suspend to ram, but I cannot resume. when I hit the power button in order to resume, the system starts to wake up, but then it stops and I have to do a hard shutdown. Looking in the system logs, there are no errors to be found. Upon the next boot, my swap partition is corrupted, and I have to remake it.

I think that the problem resides in the fact that I could not make the changes in my initrd file that are suggested at

This step fails:

find . | cpio -o -c |gzip -9 > /boot/initrd-2.6.9-suspend.img.

I get the following messages:

cpio: hotplug-2004_04_01-8: No such file or directory
cpio: libxml2-devel-2.6.16-3: No such file or directory
cpio: zip-2.3-26.3: No such file or directory
cpio: kernel-module-ati-2.6.8-1.521-3.14.1-0: No such file or directory
cpio: gamin-devel-0.0.17-1.FC3: No such file or directory
cpio: fonts-xorg-100dpi-6.8.1-1: No such file or directory
cpio: samba-common-3.0.9-1.fc3: No such file or directory
cpio: valknut-0.3.4cvs20041127-1: No such file or directory
cpio: xvidcore-1.0.2-2.1.fc3.rf: No such file or directory
cpio: syslinux-2.11-2.1.fc3.rf: No such file or directory
cpio: xorg-x11-deprecated-libs-devel-6.8.1-12.FC3.21: No such file or directory
cpio: xorg-x11-xauth-6.8.1-12.FC3.21: No such file or directory
cpio: gtk2-devel-2.4.14-1.fc3: No such file or directory
cpio: apt-0.5.15cnc6-3.1.fc3.rf: No such file or directory
cpio: nvidia-graphics4496-libs-1.0_4496-65.rhfc3.at: No such file or directory
cpio: kdelibs-3.3.1-2.4.FC3: No such file or directory

I get one of these for every single rpm package that I have installed.
Is there something I missed??

18th December 2004, 08:29 AM
Scratch that. At this site, http://www.tummy.com/journals/entries/jafo_20041212_004738 , i found a nice addition to /sbin/mkinitrd so that i could use mkinitrd to create an initrd with the correct parameters.
However, this problem still exists when suspending to ram. It starts to wake up, and then hangs.

30th December 2004, 03:34 PM
It works for me too, many thanks cghubbell
I applied swsusp patches, the two fixes on kernel 681, uncommented the lines after "### xhacks" in hibernate.conf, added
"echo > /proc/software_suspend/do_resume" just before "echo Creating /dev" in init inside initrd

Such a long time I was looking for this feature
Thanks a lot everybody

27th April 2005, 06:18 AM
I use the kernels from:

He has the latest fedora core 3 kernels as rpms patched with instructions.

Hibernate is working perfectly on my Thinkpad R50.