星期一, 12月 08, 2008

Useful basic information for hibernate function under RHEL or SuSE

I use Ubuntu with rtl8187 module for realtek chipset.
The sleep/suspend/hibernate function all fail in just starting stage and without any errors.
The solution and information:

Hibernate issues almost caused by driver, especially network and storage driver.
No screen, just can remove some drivers first.
Use pm-suspend/pm-hibernate or /sys/power/ folder to test.

Method 1
in /etc/pm/conf.d/ create a file name "unload_module" (any name is fine)
in unload_module add a line "SUSPEND_MODULES="rtl8187 rt8189 .....""

Method 2
add "02wireless" file in /usr/lib/pm-utils/sleep.d/ and the content as followings.

#!/bin/sh


case $1 in
suspend|hibernate) ifdown wlan0 ; rmmod rtl8187 ;;
resume|thaw) modprobe rtl8187 ;;
*) exit $NA ;;
esac
exit 0

** Still need to clean something in the future.

RHEL

package: hal/pm-utils
folder: /etc/pam.d;/etc/hal;/usr/lib64/hal;/usr/lib/pm-utils/sleep.d (hibernate stage folder)
command: pm-hibernate;lshal
script file: /usr/lib64/hal/scripts/linux/hal-system-power-hibernate-linux
(can check hal package list.)
log: /var/log/pm/suspend.log

SuSE

package: hal/powersave
folder: /etc/hal;
command: powersave;lshal
script file:
1. /usr/lib64/hal/scripts/hal-system-power-hibernate
2. /usr/lib/powersave/scripts/prepare_suspend_to_disk (include GRUB info)
3. /usr/lib/powersave/scripts/sleep_helper_functions
log: /var/log/suspend2disk.log