31
27
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VGA_MODE_3" = "true" ] && QUIRKS="$QUIRKS --quirk-vga-mode3"
32
28
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST" = "true" ] && QUIRKS="$QUIRKS --quirk-vbe-post"
33
29
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
30
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RESET_BRIGHTNESS" = "true" ] && QUIRKS="$QUIRKS --quirk-reset-brightness"
31
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_NONE" = "true" ] && QUIRKS="$QUIRKS --quirk-none"
35
#PMU systems cannot use /sys/power/state yet, so use a helper to issue an ioctl
36
if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" = "pmu" ]; then
37
hal-system-power-pmu sleep
39
echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2
33
# Urh. Do any BIOSen handle this correctly?
34
if [ $seconds_to_sleep != "0" ] ; then
45
#ALTLinux only supports powersave
46
if [ -f "/etc/altlinux-release" ]; then
47
if [ -x /usr/bin/powersave ] ; then
48
$POWERSAVED_SUSPEND2RAM
55
#Mandriva supports suspend-scripts
56
elif [ -f "/etc/mandriva-release" ] ; then
57
# TODO: fix pmsuspend to take a --wakeup-alarm argument
58
if [ $seconds_to_sleep != "0" ] ; then
62
if [ -x "/usr/sbin/pmsuspend" ] ; then
63
/usr/sbin/pmsuspend memory
70
#RedHat/Fedora and SUSE support pm-utils
71
elif [ -f "/etc/redhat-release" ] || [ -f "/etc/fedora-release" ] \
72
|| [ -f "/etc/SuSE-release" ] ; then
73
# TODO: fix pm-suspend to take a --wakeup-alarm argument
74
if [ $seconds_to_sleep != "0" ] ; then
77
# TODO: fixup pm-suspend to define erroc code (see alarm above) and throw
78
# the appropriate exception
79
if [ -x "/usr/sbin/pm-suspend" ] ; then
80
/usr/sbin/pm-suspend $QUIRKS
87
#Other distros just need to have *any* tools installed
38
# We only support pm-utils
39
if [ -x "/usr/sbin/pm-suspend" ] ; then
40
/usr/sbin/pm-suspend $QUIRKS
89
if [ -x "/usr/bin/powersave" ] ; then
90
$POWERSAVED_SUSPEND2RAM
92
elif [ -x "/usr/sbin/pmi" ] ; then
93
/usr/sbin/pmi action suspend force
95
elif [ -x "/usr/sbin/pm-suspend" ] ; then
96
/usr/sbin/pm-suspend $QUIRKS
98
elif [ -w "/sys/power/state" ] ; then
99
# Use the raw kernel sysfs interface
100
echo "mem" > /sys/power/state
103
# TODO: add other scripts support
108
#Refresh devices as a resume can do funny things
47
# Refresh devices as a resume can do funny things
109
48
for type in button battery ac_adapter
111
50
devices=`hal-find-by-capability --capability $type`