This section documents how hibernate was setup with Debian GNU/Linux on Linuxvillage's desktop and laptop computers. This disclosure is made in the spirit of Free Software so that users can help themselves and their neighbours.
Software Suspend2 was chosen for all desktop and laptop computer. Unlike suspend to RAM, hibernate does not use any power and is not susceptible to power outage. Hibernate does however, take slightly longer to hibernate and resume. Typically less than 1/2 a minute. No suspend to RAM is available on any machine.
All material presented are licensed under The GNU Free Documentation License.
Please report problems and direct enquiries to Contact US.
To have Software Suspend2 working on your Debian machine, you will need:
/usr/srcdirectory.
/usr/srcfor creating initrd image, can be found in Downloads.
srcgroup.
Updated: 2006-11-17
Back to topSelect Application->Accessories->Terminal and Change directory into source, uncompress the kernel source file and create a symbolic link to it.
$ cd /usr/src $ tar --bzip2 -xf linux-source-2.6.18-product_XX.XX_i386.tar.bz2 $ ln -s linux-source-2.6.18 linux
Edit kernel-pkg.conf
, to add maintainer, email and version information. You will need to SU to root prompt to accomplish that.
$ su # editor /etc/kernel-pkg.conf # exit
... # The maintainer information. maintainer := Linuxvillage.ca email := support@linuxvillage.ca ... # debian = $(version)-0.01.Custom debian = 10.03 ...
Test patch the kernel, if no errors patch it. Copy init-suspend2
to /etc/initramfs-tools/scripts/init-premount/
$ cd /usr/src/linux $ bzcat /usr/src/suspend2-2.2.9-for-2.6.18.3.patch.bz2 | patch -p1 --dry-run $ bzcat /usr/src/suspend2-2.2.9-for-2.6.18.3.patch.bz2 | patch -p1 $ su # cp /usr/src/init-suspend2 /etc/initramfs-tools/scripts/init-premount # exit
Get a copy the running kernel's configuration as a starting point. Replace the name found in /boot
directory.
Change directory to source, initialize the environment and configure kernel.
$ cp /boot/config-2.6.18-7-k7 /usr/src/linux/.config $ cd /usr/src/linux $ make menuconfig
In menuconfig:
Compile the kernel.
$ cd /usr/src/linux $ make-kpkg clean $ fakeroot make-kpkg --initrd --append_to_version -custom kernel_image modules_image
If there are no errors, remove the init-suspend2 file and install the custom kenrel.
$ cd /usr/src $ su # rm /etc/initramfs-tools/scripts/init-premount/init-suspend2 # dpkg -i linux-image-2.6.18-7-custom_10.03_i386.deb # exit
That's it for kernel compile and patching.
Updated: 2006-11-17
Back to topAfter hibernate program from Synaptic Package Manager was installed. A few extra configuration is needed. Each computer model may have slightly different settings, the patchset form the private repository contain patch files to update them automatically.
To change the configuration files, Select Application->Accessories->Root Terminal and edit the following list.
# editor /etc/hibernate/suspend2.conf
Change the swap partition and userui program during suspend and resume. Note: userui is optional.
SuspendDevice swap:/dev/sda7 ProcSetting userui_program /usr/sbin/suspend2ui_text
# editor /etc/hibernate/common.conf
Force suspend because of NVIDIA kernel driver, Full speed cpu, Lock GNOME screen during resume for security, Mute/Pause audio to save you from getting kick out of the library, switch to text mode and use dummy xserver for reliability.
AlwaysForce yes FullSpeedCPU yes LockGnomeScreenSaver yes MuteAudio yes PauseAudio yes SwitchToTextMode no UseDummyXServer no
Create a group to contain permission for hibernation and add existing users to group.
# addgroup hibernate # useradd -G hibernate johnny
Use visudo to grant privilege for group hibernate to execute hibernation program.
# visudo
Add the following line in sudoer file. Replace suspend2wrapper.sh with hibernate if you don't want to use it.
%hibernate ALL=NOPASSWD: /usr/sbin/suspend2wrapper.sh
Note: when ever new users are added, you will need to add them to this group to allow for hibernation.
Copy suspend2wrapper.sh to /usr/sbin
cp /usr/src/suspend2wrapper.sh /usr/sbin
suspend2wrapper.sh reverts to older alogrithm and contains model specific customization prior to calling hibernate.
echo 1 > /sys/power/suspend2/full_pageset2
For model specific details check the Product Information section in support.
Updated: 2006-11-17
Back to topEdit grub parameters in /boot/grub/menu.lst
and add the swap parameters. Replace sda7 with the swap partition on your system.
# defoptions=... resume2=swap:/dev/sda7 # altoptions=(single-user mode) single resume2=noresume ...
Update grub. Make sure not to update the kernel parameters in the selection menu because they would get lost mysteriously next time grub is updated. Check the updated menu.lst file with less.
$ su # editor /boot/grub/menu.lst # update-grub # less /boot/grub/menu.lst # exit
The following lines should be in menu.lst.
... ## additional options to use with the default boot option, but not with the ## alternatives ## e.g. defoptions=vga=791 resume=/dev/hda5 # defoptions=... resume2=swap:/dev/sda7 ... ## altoption boot targets option ## multiple altoptions lines are allowed ## e.g. altoptions=(extra menu suffix) extra boot options # altoptions=(single-user mode) single resume2=noresume ... ,,,
Updated: 2006-11-17
Back to topUser guide are specific to products, Laptops have special keys on the keyboard for hibernating and is triggered by acpi-support. Desktop computers uses GNOME menu items to trigger hibernation. Please check individual product for more detail documentation.
Updated: 2006-11-17
Back to top