|
TuxOnIce development has been sponsored by:
|
Next
Previous
Contents
7. Other configurations7.1 TuxOnIce compiled as modules (after 2.2.9)Support for compiling TuxOnIce as modules was removed for quite a while, but has returned after the 2.2.9 release. Building TuxOnIce as modules lets you free the memory for other uses when not hibernating, which is particularly useful in embedded applications. 7.2 Using a swapfile
Superfluous detailsSpecifying the resume= device simply tells TuxOnIce where to write and find the header that indicates the machine is suspended and where to find the rest of the image. The image itself is written to any available swapspace whether it be swapfile or swap partition. The actual order of swap devices that data is written to turns out to essentially be the order in which swap partitions are enabled. Hence it's entirely plausible if you have a normal swap partition (or file), and one turned on only for hibernating, that the entire image is contained in the first swap partition, but the header alone is in the second. 7.3 Swap on LVM/dm-cryptThis requires Suspend2 2.1.4.2 or later. You need to setup LVM/encrypted swap before TuxOnIce attempts to resume. This means you need an initrd or initramfs. The linuxrc/init script on such an initrd/initramfs roughly needs to do the following steps:
Of course you need to make sure that all the binaries and libraries you need are on the initrd/initramfs. 7.4 Using an initrd/initramfs but TuxOnIce compiled inIf you are using an initrd, you MUST edit the linuxrc script to attempt to resume before filesystems are mounted. Do this by inserting the line: echo 1 > /sys/power/tuxonice/do_resumesomewhere after mount /proc but before mounting filesystems in your linuxrc script. If you are using an initramfs, you will need to do the same thing to your /sbin/init script, else you will never be able to resume. See the Modules FAQ for some distribution-specific tips. 7.5 Keep image modeThe idea behind keep-image mode is that when you have resumed, the image is not invalidated, meaning you can resume from it several times. This is useful in kiosk-type situations, or perhaps in computing labs, where you want to boot quickly to a known state, every time. The only caveats with keep-image mode is that no filesystem that is backed on disk can be mounted read-write in the suspended image. Nor can they be modified without creating a new resume image. The two issues to keep in mind are that:
Memory-backed filesystems (eg, tmpfs) are safe - their state is restored to how things were at hibernation time. You may also mount filesystems after resuming without much concern. To setup a system for keep-image mode, you setup your machine how you want it at resume time, then mount all your disk-backed filesystems read-only or unmounted. Then (with a kernel compiled with keep-image mode - CONFIG_SUSPEND2_KEEP_IMAGE), and hibernate in the usual manner.echo 1 > /sys/power/tuxonice/keep_image When you resume, the image is not invalidated, so you can resume from it as many times as you like. So long as the state of the filesystem on the hard disk does not change, you should be safe. Next Previous Contents Last updated: Fri, 14 Nov 2008 08:05:49 +0800 Frozen penguins image by darkmetal and adapted by Nigel Cunningham "Tuxsicle" artwork by Pierre-Philippe Coupard Copyright © 2003-2005 Bernard B |