hal: Branch 'master' - 3 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Mon Jul 2 15:46:26 PDT 2007
tools/linux/hal-system-power-hibernate-linux | 61 +--------------
tools/linux/hal-system-power-suspend-hybrid-linux | 16 ++++
tools/linux/hal-system-power-suspend-linux | 84 ++--------------------
3 files changed, 34 insertions(+), 127 deletions(-)
New commits:
diff-tree e8a22c066d0e1b6861e801fe9a517ddaef568708 (from parents)
Merge: 3f4580dfe7a5abf3acb1aabf58d03a50cf5137fa 0d6f53e362552899648467c22c767570b0825029
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Jul 2 23:44:15 2007 +0100
Merge branch 'master' of git+ssh://hughsient@git.freedesktop.org/git/hal
diff-tree 3f4580dfe7a5abf3acb1aabf58d03a50cf5137fa (from 532101d8f8929b566240ff77e50928f91381f6b9)
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Jul 2 23:43:06 2007 +0100
propagate --quirk-none to pm-utils
Propagate --quirk-none to pm-utils so we can tell if a system will suspend
by having a set quirk even tho we need to do nothing.
diff --git a/tools/linux/hal-system-power-hibernate-linux b/tools/linux/hal-system-power-hibernate-linux
index 7b567d8..aa1905f 100755
--- a/tools/linux/hal-system-power-hibernate-linux
+++ b/tools/linux/hal-system-power-hibernate-linux
@@ -19,6 +19,7 @@ QUIRKS=""
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VGA_MODE_3" = "true" ] && QUIRKS="$QUIRKS --quirk-vga-mode3"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST" = "true" ] && QUIRKS="$QUIRKS --quirk-vbe-post"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_NONE" = "true" ] && QUIRKS="$QUIRKS --quirk-none"
# We only support pm-utils
if [ -x /usr/sbin/pm-hibernate ] ; then
diff --git a/tools/linux/hal-system-power-suspend-hybrid-linux b/tools/linux/hal-system-power-suspend-hybrid-linux
index c693943..8e5bc6c 100755
--- a/tools/linux/hal-system-power-suspend-hybrid-linux
+++ b/tools/linux/hal-system-power-suspend-hybrid-linux
@@ -27,6 +27,7 @@ QUIRKS=""
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VGA_MODE_3" = "true" ] && QUIRKS="$QUIRKS --quirk-vga-mode3"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST" = "true" ] && QUIRKS="$QUIRKS --quirk-vbe-post"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_NONE" = "true" ] && QUIRKS="$QUIRKS --quirk-none"
# We only support pm-utils
if [ -x "/usr/sbin/pm-suspend-hybrid" ] ; then
diff --git a/tools/linux/hal-system-power-suspend-linux b/tools/linux/hal-system-power-suspend-linux
index 511e21b..425d56b 100755
--- a/tools/linux/hal-system-power-suspend-linux
+++ b/tools/linux/hal-system-power-suspend-linux
@@ -27,6 +27,7 @@ QUIRKS=""
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VGA_MODE_3" = "true" ] && QUIRKS="$QUIRKS --quirk-vga-mode3"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST" = "true" ] && QUIRKS="$QUIRKS --quirk-vbe-post"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_NONE" = "true" ] && QUIRKS="$QUIRKS --quirk-none"
# Urh. Do any BIOSen handle this correctly?
if [ $seconds_to_sleep != "0" ] ; then
diff-tree 532101d8f8929b566240ff77e50928f91381f6b9 (from b6627461f897e0f6886ef73cbf415a28afa53279)
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Jul 2 23:35:30 2007 +0100
only allows the use of pm-utils for suspend, hibernate and suspend-hybrid
Only allow pm-utils to suspend and hibernate in the helper scripts. This is
something that's been on the HAL TODO for a few months.
Distros can still patch in other support if *really* required, but
upstream only should support one 'blessed' method.
diff --git a/tools/linux/hal-system-power-hibernate-linux b/tools/linux/hal-system-power-hibernate-linux
index d38c509..7b567d8 100755
--- a/tools/linux/hal-system-power-hibernate-linux
+++ b/tools/linux/hal-system-power-hibernate-linux
@@ -1,9 +1,5 @@
#!/bin/sh
-POWERSAVED_SUSPEND2DISK="dbus-send --system --dest=com.novell.powersave \
- --print-reply /com/novell/powersave \
- com.novell.powersave.action.SuspendToDisk"
-
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
echo No hibernate script found >&2
@@ -24,57 +20,13 @@ QUIRKS=""
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST" = "true" ] && QUIRKS="$QUIRKS --quirk-vbe-post"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
-#ALTLinux only supports powersave
-if [ -f /etc/altlinux-release ] ; then
- if [ -x /usr/bin/powersave ] ; then
- $POWERSAVED_SUSPEND2DISK
- RET=$?
- else
- unsupported
- fi
-
-#Mandriva support suspend-scripts
-elif [ -f /etc/mandriva-release ] ; then
- if [ -x /usr/sbin/pmsuspend ] ; then
- /usr/sbin/pmsuspend disk
- RET=$?
- else
- unsupported
- fi
-
-#RedHat/Fedora and SUSE support support pm-utils
-elif [ -f /etc/redhat-release ] || [ -f /etc/fedora-release ] \
- || [ -f "/etc/SuSE-release" ] ; then
- if [ -x /usr/sbin/pm-hibernate ] ; then
- /usr/sbin/pm-hibernate $QUIRKS
- RET=$?
- else
- unsupported
- fi
-
-#Other distros just need to have *any* tools installed
+# We only support pm-utils
+if [ -x /usr/sbin/pm-hibernate ] ; then
+ /usr/sbin/pm-hibernate $QUIRKS
+ RET=$?
else
- if [ -x "/usr/bin/powersave" ] ; then
- $POWERSAVED_SUSPEND2DISK
- RET=$?
- elif [ -x "/usr/sbin/pmi" ] ; then
- /usr/sbin/pmi action hibernate force
- RET=$?
- elif [ -x "/usr/sbin/pm-hibernate" ] ; then
- /usr/sbin/pm-hibernate $QUIRKS
- RET=$?
- elif [ -x "/usr/sbin/hibernate" ] ; then
- # Suspend2 tools installed
- /usr/sbin/hibernate --force
- RET=$?
- elif [ -w "/sys/power/state" ] ; then
- # Use the raw kernel sysfs interface
- echo "disk" > /sys/power/state
- RET=$?
- else
- unsupported
- fi
- fi
+ unsupported
+fi
#Refresh devices as a resume can do funny things
for type in button battery ac_adapter
diff --git a/tools/linux/hal-system-power-suspend-hybrid-linux b/tools/linux/hal-system-power-suspend-hybrid-linux
index fc80ad0..c693943 100755
--- a/tools/linux/hal-system-power-suspend-hybrid-linux
+++ b/tools/linux/hal-system-power-suspend-hybrid-linux
@@ -14,6 +14,21 @@ unsupported() {
read seconds_to_sleep
+# Make a suitable command line argument so that the tools can do the correct
+# quirks for video resume.
+# Passing the quirks to the tool allows the tool to not depend on HAL for data.
+QUIRKS=""
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_S3_BIOS" = "true" ] && QUIRKS="$QUIRKS --quirk-s3-bios"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_S3_MODE" = "true" ] && QUIRKS="$QUIRKS --quirk-s3-mode"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_DPMS_SUSPEND" = "true" ] && QUIRKS="$QUIRKS --quirk-dpms-suspend"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_DPMS_ON" = "true" ] && QUIRKS="$QUIRKS --quirk-dpms-on"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBESTATE_RESTORE" = "true" ] && QUIRKS="$QUIRKS --quirk-vbestate-restore"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBEMODE_RESTORE" = "true" ] && QUIRKS="$QUIRKS --quirk-vbemode-restore"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VGA_MODE_3" = "true" ] && QUIRKS="$QUIRKS --quirk-vga-mode3"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST" = "true" ] && QUIRKS="$QUIRKS --quirk-vbe-post"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
+
+# We only support pm-utils
if [ -x "/usr/sbin/pm-suspend-hybrid" ] ; then
if [ $seconds_to_sleep != "0" ] ; then
alarm_not_supported
diff --git a/tools/linux/hal-system-power-suspend-linux b/tools/linux/hal-system-power-suspend-linux
index 58a5915..511e21b 100755
--- a/tools/linux/hal-system-power-suspend-linux
+++ b/tools/linux/hal-system-power-suspend-linux
@@ -1,9 +1,5 @@
#!/bin/sh
-POWERSAVED_SUSPEND2RAM="dbus-send --system --dest=com.novell.powersave \
- --print-reply /com/novell/powersave \
- com.novell.powersave.action.SuspendToRam"
-
alarm_not_supported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.AlarmNotSupported >&2
echo Waking the system up is not supported >&2
@@ -32,78 +28,19 @@ QUIRKS=""
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST" = "true" ] && QUIRKS="$QUIRKS --quirk-vbe-post"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
-# PMU systems cannot use /sys/power/state yet, so use a helper to issue an ioctl
-if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" = "pmu" ]; then
- hal-system-power-pmu sleep
- if [ $? -ne 0 ]; then
- echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2
- exit 1
- fi
- exit 0
+# Urh. Do any BIOSen handle this correctly?
+if [ $seconds_to_sleep != "0" ] ; then
+ alarm_not_supported
fi
-# ALTLinux only supports powersave
-if [ -f "/etc/altlinux-release" ]; then
- if [ -x /usr/bin/powersave ] ; then
- $POWERSAVED_SUSPEND2RAM
- RET=$?
- else
- # TODO: add support
- unsupported
- fi
-
-# Mandriva supports suspend-scripts
-elif [ -f "/etc/mandriva-release" ] ; then
- # TODO: fix pmsuspend to take a --wakeup-alarm argument
- if [ $seconds_to_sleep != "0" ] ; then
- alarm_not_supported
- fi
-
- if [ -x "/usr/sbin/pmsuspend" ] ; then
- /usr/sbin/pmsuspend memory
- RET=$?
- else
- # TODO: add support
- unsupported
- fi
-
-# RedHat/Fedora and SUSE support pm-utils
-elif [ -f "/etc/redhat-release" ] || [ -f "/etc/fedora-release" ] \
- || [ -f "/etc/SuSE-release" ] ; then
- # TODO: fix pm-suspend to take a --wakeup-alarm argument
- if [ $seconds_to_sleep != "0" ] ; then
- alarm_not_supported
- fi
- # TODO: fixup pm-suspend to define erroc code (see alarm above) and throw
- # the appropriate exception
- if [ -x "/usr/sbin/pm-suspend" ] ; then
- /usr/sbin/pm-suspend $QUIRKS
- RET=$?
- else
- # TODO: add support
- unsupported
- fi
-
-# Other distros just need to have *any* tools installed
+# We only support pm-utils
+if [ -x "/usr/sbin/pm-suspend" ] ; then
+ /usr/sbin/pm-suspend $QUIRKS
+ RET=$?
else
- if [ -x "/usr/bin/powersave" ] ; then
- $POWERSAVED_SUSPEND2RAM
- RET=$?
- elif [ -x "/usr/sbin/pmi" ] ; then
- /usr/sbin/pmi action suspend force
- RET=$?
- elif [ -x "/usr/sbin/pm-suspend" ] ; then
- /usr/sbin/pm-suspend $QUIRKS
- RET=$?
- elif [ -w "/sys/power/state" ] ; then
- # Use the raw kernel sysfs interface
- echo "mem" > /sys/power/state
- RET=$?
- else
- # TODO: add other scripts support
- unsupported
- fi
- fi
+ # TODO: add support
+ unsupported
+fi
# Refresh devices as a resume can do funny things
for type in button battery ac_adapter
More information about the hal-commit
mailing list