[ltp] Re: ANNOUNCE: FC3 + swsusp kernel

linux-thinkpad@linux-thinkpad.org linux-thinkpad@linux-thinkpad.org
Tue, 16 Nov 2004 01:51:41 +0000 (GMT)


OK, a couple of patches to apply to the Fedora Core 3 kernel to allow
the swsusp2 patches to apply cleanly.  I'm not taking any credit for
these, other than being the guinea-pig for Bernard from the swsusp2
project and being prepared to go through a dozen or so fsck cycles
and a lot of trial and error to fix them.

Here's a recipe for compiling swsusp2 support in for those Fedora
users who haven't before.  Download the patches here:
http://helicon.ucs.uwa.edu.au/~bernard/fc3/
- just two very small patches to prepare the FC3 kernel source tree
for the standard swsusp2 patches.  These don't remove any of the
Fedora patches, they just do some jiggling so that the swsusp2 patches
apply cleanly.

Then download the standard swsusp2 2.6.9 kernel patches, version 2.1.5
(the latest) from:

http://softwaresuspend.berlios.de/

Having unpacked them, just add the two patches above to the directory
of swsusp2 patches.  Follow the instructions on the swsusp site above
by running the ./apply script to apply them to your FC3 kernel source
tree.

Note that, for new FC3 users, FC3 doesn't come with a kernel-sourcecode 
RPM anymore - you need to install the kernel-<version>.src.rpm and then:
# rpmbuild -bp --target=i686 /usr/src/redhat/SPECS/kernel-2.6.spec
- the kernel source will then be in 
/usr/src/redhat/BUILD/kernel-<version>/linux-<version>

Having applied the patches above, which should apply cleanly, supply
your .config (see caveat below) and compile your Fedora kernel in the 
normal way:
# make oldconfig
# make
# make modules_install
# make install
If you didn't change Makefile, your kernel will be installed at
/boot/vmlinuz-<version>-prep.  Check you have a grub entry for this
kernel.

Finally you need to do a little magic to your initrd image to make it
work with initramfs in FC3 - see:
http://softwaresuspend.berlios.de/FAQ-6.html#ss6.8
I found I needed to add this line after mounting /proc and /sys in init.
Download the hibernate script from the swsusp site, and try it out.
Then you can tie this to a key combination with ibm-acpi, etc.

Kernel config caveat: so far, it seems that you need to unset
CONFIG_X86_4G in your .config.  The FC3 kernel seems to set this on
by default and it seems to stop the machine properly resuming.

As mentioned before, FC3 contains enhanced 3D support for some
thinkpad ATI cards, and they'll stop resume unless you turn on a
couple of options in /etc/hibernate/hibernate.conf:
LeaveXBeforeSuspend yes
nVidiaHack yes

Bernard has some confidence that these patches will last some time,
or need only a little tweaking for future FC3 kernel release and
swsusp2 releases - they're quite simple.  They might even work with
the FC2 2.6.9 kernel - I've not tried.  Remember swsusp2 is a work in
progress, so you may want to test mounting / readonly at first from
singleuser for safety first.  Works for me.

Hope this helps someone.
Honey