3
POWERSAVED_SUSPEND2DISK="dbus-send --system --dest=com.novell.powersave \
4
--print-reply /com/novell/powersave \
5
com.novell.powersave.action.SuspendToDisk"
8
4
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
9
5
echo No hibernate script found >&2
23
19
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VGA_MODE_3" = "true" ] && QUIRKS="$QUIRKS --quirk-vga-mode3"
24
20
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST" = "true" ] && QUIRKS="$QUIRKS --quirk-vbe-post"
25
21
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
27
#ALTLinux only supports powersave
28
if [ -f /etc/altlinux-release ] ; then
29
if [ -x /usr/bin/powersave ] ; then
30
$POWERSAVED_SUSPEND2DISK
36
#Mandriva support suspend-scripts
37
elif [ -f /etc/mandriva-release ] ; then
38
if [ -x /usr/sbin/pmsuspend ] ; then
39
/usr/sbin/pmsuspend disk
45
#RedHat/Fedora and SUSE support support pm-utils
46
elif [ -f /etc/redhat-release ] || [ -f /etc/fedora-release ] \
47
|| [ -f "/etc/SuSE-release" ] ; then
48
if [ -x /usr/sbin/pm-hibernate ] ; then
49
/usr/sbin/pm-hibernate $QUIRKS
55
#Other distros just need to have *any* tools installed
22
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RESET_BRIGHTNESS" = "true" ] && QUIRKS="$QUIRKS --quirk-reset-brightness"
23
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_NONE" = "true" ] && QUIRKS="$QUIRKS --quirk-none"
25
# We only support pm-utils
26
if [ -x /usr/sbin/pm-hibernate ] ; then
27
/usr/sbin/pm-hibernate $QUIRKS
57
if [ -x "/usr/bin/powersave" ] ; then
58
$POWERSAVED_SUSPEND2DISK
60
elif [ -x "/usr/sbin/pmi" ] ; then
61
/usr/sbin/pmi action hibernate force
63
elif [ -x "/usr/sbin/pm-hibernate" ] ; then
64
/usr/sbin/pm-hibernate $QUIRKS
66
elif [ -x "/usr/sbin/hibernate" ] ; then
67
# Suspend2 tools installed
68
/usr/sbin/hibernate --force
70
elif [ -w "/sys/power/state" ] ; then
71
# Use the raw kernel sysfs interface
72
echo "disk" > /sys/power/state
79
33
#Refresh devices as a resume can do funny things
80
34
for type in button battery ac_adapter