suspend2.net rocks!

My last major requirement was decent hibernate & resume, the standard suspend to disk in 2.6.8/10 didn’t cut it, so I started on patching the kernel with stuff from suspend2.net, but it wouldn’t patch a debian’ised kernel source, or even any kernel source I tried to pull from kernel.org, then I remembered a post on debian-laptop about a some debian’ised suspend2 patches, some hunting through my inbox and I found it:

Hello, world.

I have just finished the first public (yet EXPERIMENTAL!) version of
the Debian software suspend 2 patch (www.suspend2.net). The patch
integrates with Debian’s kernel-package and modifies the
kernel-image in such a way as to automatically modify any initial
ramdisk and reinitialise swap partitions to preven data loss.

The patch currently supports Debian kernels 2.6.8 and 2.6.10. For
best results, use the latest kernel. I did most of my testing with
2.6.10 on i386. Patches for 2.4.2[789] and 2.6.11 are also included
but not tested. 2.4.27 does not currently apply to the Debian
kernels, but should be usable with vanilla ones.

Help in porting the patch to other Debian kernels would be greatly
appreciated. I am especially looking for an elegant way to support
Debian and vanilla kernels from the same source.

I am not going to upload the patch to unstable yet, but it has been
submitted to the Debian experimental archive. It will go into
unstable when I have received enough positive feedback and no
serious bugs exist.

At this point, I want to thank Nigel and everyone else who
contributed for the slick patch, which works very nicely. Also
thanks to Nigel for backporting the 2.1 version to the 2.6.8.1
kernel, which is going to be the standard 2.6 kernel for Debian
sarge.

If you want to give the patch a whirl, you can obtain it from the
following APT repository:

deb http://debian.madduck.net ~madduck/packages/stage/kernel-patch-suspend2/
deb-src http://debian.madduck.net ~madduck/packages/stage/kernel-patch-suspend2/

then install it:

apt-get update
apt-get install kernel-patch-suspend2

and then compile the kernel:

tar xjf /usr/src/kernel-source-2.6.10.tar.bz2
cd kernel-source-2.6.10
make-kpkg –added-patches suspend2 … binary

Then, install the kernel-image and reboot.

Note that I did my testing using an initial ramdisk (basically the
plain Debian kernel with SUSPEND2 enabled). If you can use an
initial ramdisk, pass the –initrd option to make-kpkg and be done.
Without an initial ramdisk, you have to make sure to pass the right
‘resume2’ value to the kernel via Grub/Lilo, or whichever is your
bootloader. I plan to add a warning about this when I have more
time.

I suggest also pulling in the hibernate image (kernel images with
this patch will Recommend it). With UseSwsusp2 set to yes in
/etc/hibernate/hibernate.conf, just running ‘hibernate’ should
suspend the machine, and it should come back up without any more of
your doing when you start it again.

Even though I did all testing on my productive machine(s) and lost
no data (knock on wood), it’s probably best if you try it on
a less-important machine. Nevertheless, you can turn off
$CHECK_SWAP_PARTITIONS_ON_BOOT in /etc/default/suspend2 to prevent
the swap partition check. Make sure to read
http://suspend2.net/HOWTO-4.html#ss4.4 about this issue.

Have fun, feedback welcome.

— Please do not send copies of list mail to me; I read the list! .”`. martin f. krafft : :’ : proud Debian developer, admin, user, and author `. `’` `- Debian – when you have better things to do than fixing a system Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver!

It works a treat!
After you’ve built your patched kerel, grab the hibernate package from suspend2.net:

wget http://cp.yi.org/apt/hibernate/hibernate_1.05-1_all.deb

dpkg -i hibernate_1.05-1_all.deb

BTW, I rebuild my kernel’s slightly differently, I don’t do initrd or anything, so all I did was:

cd /usr/src/linux
make-kpkg –added-patches suspend2 –append-to-version -sm7-suspend2 kernel_image

I do this because I sm7 indicates that this is the 7th interation of tweaking settings for this laptop, and that the suspend2 patch has been applied, it makes the kernel namesa bit long, but easier to spot what I’ve done 🙂

Reboot using your new kernel, et voila! You’re ready to hibernate, get all your usual apps up and running (Thunderbird, Firefox, Word using CrossOver), fire up a shell, su to root and type hibernate, it rocks…

Settling in nicely…

So I’ve had Debian Unstable on the laptop for a week or two now and I think I’ve finished all the config/migrate work. I’ve got the wireless card working (using ipw2100 & waproamd, I tried wpasupplicant, but I only need WEP and WEP is broken for wpasuplicant & ipw2100’s), gprs over bluetooth and the the built-in modem (using sl-modem-daemon & sl-modem-source). I haven’t got suspend working at all, for disk or memory. Applying the suspend2.net patches to straight kernel sources or debian-patched kernel sources seems way to hard, it looks like I’ll have to have a look at bitkeeper and pull a patched kernel dtraight from the suspend2 guys. Here’s a quick rundown of my original requirements and how I’ve met them:

  • Multiple network access methods (wired, wireless, gprs) all to work smoothly

    (RealTek RTL8139 support in kernel, ipw2100 support from ipw2100.sourceforge.net, bluez, rfcomm & pppd are all that’s needed for gprs)

  • Offline Email

    (Thunderbird’s clunky offline support will do for now)

  • Offline Network Shares

    (hmm, not quite there yet on this, probably going ti endup using rsync/drsync/unison to sync directories)

  • VPN Access (currently we use SSH for crude but effective VPN access, IPSec is on it’s way, as is Citrix SG if I ever get a chance!)

    (OpenSSH, need I say more? Need to look at using OpenSWAN with 2.6 IPSec…)

  • Proper wordprocessing & spreadsheet tools, this pretty much means Word & Excel, as we’re stuck in the “that’s what everybody else is using” rut.

    (One of my collegues was using CrossOver Office, I was mightly impressed and looked at using Wine and then CrossOver, which is a whole $40, which is nothing, so I’m running the CrossOver eval and will get the full product in due course!)

  • Encryptable disk space & Cross platform encryptable USB stick support.

    (I’ve been looking at Jetico’s BestCrypt, I have been using it under XP and was quite impressed, however when I took my encrypted volume from XP & tried to open it under Linux, it complained bitterly)

So, getting there, I need to get suspend of some form working…