diff -Nru acpi-support-0.121/debian/changelog acpi-support-0.122/debian/changelog --- acpi-support-0.121/debian/changelog 2009-03-25 15:49:19.000000000 -0400 +++ acpi-support-0.122/debian/changelog 2009-04-24 10:29:04.000000000 -0400 @@ -1,3 +1,15 @@ +acpi-support (0.122) karmic; urgency=low + + * lib/power-funcs: + - Add halAction, halSuspend, and halHibernate functions. These call + HAL's power management actions via dbus. + * sleep.sh, hibernate.sh: + - Try using new halSuspend/halHibernate functions, then fallback to + pm-utils, then fall back to existing custom acpi-support methods. + LP: #366119 + + -- Michael Terry Fri, 24 Apr 2009 10:27:20 -0400 + acpi-support (0.121) jaunty; urgency=low * Remove /etc/modprobe.d/ibm_acpi.modprobe in case it's still present; diff -Nru acpi-support-0.121/hibernate.sh acpi-support-0.122/hibernate.sh --- acpi-support-0.121/hibernate.sh 2009-03-25 15:49:19.000000000 -0400 +++ acpi-support-0.122/hibernate.sh 2009-04-24 10:05:21.000000000 -0400 @@ -11,37 +11,39 @@ exit; fi -# Unset video posting - it's not needed for suspend to disk -unset POST_VIDEO -unset USE_DPMS - -. /etc/acpi/prepare.sh - -#if [ x$LOCK_SCREEN = xtrue ]; then -# for x in /tmp/.X11-unix/*; do -# displaynum=`echo $x | sed s#/tmp/.X11-unix/X##` -# getXuser; -# if [ x"$XAUTHORITY" != x"" ]; then -# export DISPLAY=":$displaynum" -# . /usr/share/acpi-support/screenblank -# fi -# done -#fi - -echo -n $HIBERNATE_MODE >/sys/power/disk - -if [ -x /sbin/s2disk ]; then - DEVICE="/dev/disk/by-uuid/`awk -F= '{print $3}' /sys/power/state -fi +if ! halHibernate && ! pm-hibernate; then + # Unset video posting - it's not needed for suspend to disk + unset POST_VIDEO + unset USE_DPMS + + . /etc/acpi/prepare.sh + + #if [ x$LOCK_SCREEN = xtrue ]; then + # for x in /tmp/.X11-unix/*; do + # displaynum=`echo $x | sed s#/tmp/.X11-unix/X##` + # getXuser; + # if [ x"$XAUTHORITY" != x"" ]; then + # export DISPLAY=":$displaynum" + # . /usr/share/acpi-support/screenblank + # fi + # done + #fi + + echo -n $HIBERNATE_MODE >/sys/power/disk + + if [ -x /sbin/s2disk ]; then + DEVICE="/dev/disk/by-uuid/`awk -F= '{print $3}' /sys/power/state + fi -$LAPTOP_MODE stop + $LAPTOP_MODE stop -. /etc/acpi/resume.sh + . /etc/acpi/resume.sh +fi diff -Nru acpi-support-0.121/lib/power-funcs acpi-support-0.122/lib/power-funcs --- acpi-support-0.121/lib/power-funcs 2009-03-25 15:49:19.000000000 -0400 +++ acpi-support-0.122/lib/power-funcs 2009-04-24 10:00:10.000000000 -0400 @@ -53,6 +53,18 @@ fi } +halAction() { + dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.$* +} + +halSuspend() { + halAction Suspend int32:0 +} + +halHibernate() { + halAction Hibernate +} + LAPTOP_MODE='/usr/sbin/laptop_mode' HDPARM='/sbin/hdparm -q' diff -Nru acpi-support-0.121/sleep.sh acpi-support-0.122/sleep.sh --- acpi-support-0.121/sleep.sh 2009-03-25 15:49:19.000000000 -0400 +++ acpi-support-0.122/sleep.sh 2009-04-24 10:06:15.000000000 -0400 @@ -39,26 +39,28 @@ fi fi -# Generic preparation code -. /etc/acpi/prepare.sh +if ! halSuspend && ! pm-suspend; then + # Generic preparation code + . /etc/acpi/prepare.sh + + if [ x$DISABLE_DMA = xtrue ] && [ -b /dev/hda ]; then + $HDPARM -d 0 /dev/hda + fi + + echo -n $ACPI_SLEEP_MODE >/sys/power/state + + if [ x$RESET_DRIVE = xtrue ] && [ -b /dev/hda ]; then + $HDPARM -w /dev/hda + $HDPARM -C /dev/hda + $HDPARM -C /dev/hda + $HDPARM -C /dev/hda + $HDPARM -d 1 /dev/hda + fi + + if [ x$DISABLE_DMA = xtrue ] && [ -b /dev/hda ]; then + $HDPARM -d 1 /dev/hda + fi -if [ x$DISABLE_DMA = xtrue ] && [ -b /dev/hda ]; then - hdparm -d 0 /dev/hda + # Generic wakeup code + . /etc/acpi/resume.sh fi - -echo -n $ACPI_SLEEP_MODE >/sys/power/state - -if [ x$RESET_DRIVE = xtrue ] && [ -b /dev/hda ]; then - hdparm -w /dev/hda - hdparm -C /dev/hda - hdparm -C /dev/hda - hdparm -C /dev/hda - hdparm -d 1 /dev/hda -fi - -if [ x$DISABLE_DMA = xtrue ] && [ -b /dev/hda ]; then - hdparm -d 1 /dev/hda -fi - -# Generic wakeup code -. /etc/acpi/resume.sh