--- tools/linux/hal-system-power-suspend-linux.orig 2007-06-25 18:26:09.000000000 -0400 +++ tools/linux/hal-system-power-suspend-linux 2007-06-25 18:29:44.000000000 -0400 @@ -18,6 +18,20 @@ 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="--from-hal" +[ "$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" + #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 @@ -70,7 +84,7 @@ echo "==== Modules loaded before suspending: ====" >> /var/lib/hal/system-power-suspend-output /sbin/lsmod >> /var/lib/hal/system-power-suspend-output echo "==== Output of /usr/sbin/pm-suspend ====" >> /var/lib/hal/system-power-suspend-output - /bin/bash -x /usr/sbin/pm-suspend >> /var/lib/hal/system-power-suspend-output 2>&1 + /bin/bash -x /usr/sbin/pm-suspend $QUIRKS >> /var/lib/hal/system-power-suspend-output 2>&1 RET=$? echo "==== DONE ====" >> /var/lib/hal/system-power-suspend-output else --- tools/linux/hal-system-power-hibernate-linux.orig 2007-06-25 18:28:43.000000000 -0400 +++ tools/linux/hal-system-power-hibernate-linux 2007-06-25 18:29:31.000000000 -0400 @@ -10,6 +10,20 @@ exit 1 } +# 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="--from-hal" +[ "$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" + #SuSE and ALTLinux only support powersave if [ -f /etc/altlinux-release ] || [ -f "/etc/SuSE-release" ] ; then if [ -x /usr/bin/powersave ] ; then @@ -39,7 +53,7 @@ echo "==== Modules loaded before hibernating: ====" >> /var/lib/hal/system-power-hibernate-output /sbin/lsmod >> /var/lib/hal/system-power-hibernate-output echo "==== Output of /usr/sbin/pm-hibernate ====" >> /var/lib/hal/system-power-hibernate-output - /bin/bash -x /usr/sbin/pm-hibernate >> /var/lib/hal/system-power-hibernate-output 2>&1 + /bin/bash -x /usr/sbin/pm-hibernate $QUIRKS >> /var/lib/hal/system-power-hibernate-output 2>&1 RET=$? echo "==== DONE ====" >> /var/lib/hal/system-power-hibernate-output else