tracking down suspend/hibernate bugs?

Paul S paulatgm at gmail.com
Wed Jan 16 00:18:12 UTC 2008


Matt Price said the following on 01/15/2008 05:35 PM:
> paul, how did you find out that the suspend button initiates quirks in
> the order you describe?  

I edited /usr/share/hal/scripts/linux/hal-syspem-power-suspend-linux and 
added a line to log the value of $QUIRKS when it was called, as follows:

# We only support pm-utils
if [ -x "/usr/sbin/pm-suspend" ] ; then
logger "pm-utils quirks are $QUIRKS"
         /usr/sbin/pm-suspend $QUIRKS
         RET=$?

then, after suspending, I just grepped /var/log/messages for "quirks" 
and it was there, like this:

paul :~$ grep quirks /var/log/messages
Jan 15 09:32:10 localhost logger: pm-suspend quirks are  --quirk-dpms-on 
--quirk-vbestate-restore --quirk-vbemode-restore --quirk-vga-mode3 
--quirk-vbe-post --quirk-reset-brightness

then, I copied the quirks options and pasted into a terminal after "sudo 
pm-suspend" and found it fails to resume (screen stays black)

>> Now that I know that, is there someplace I can config which quirks are
>> called and in what order?
>>
>>
> take a look
> at /usr/share/hal/scripts/linux/hal-syspem-power-suspend-linux & related
> scripts -- the $QUIRK variable is built up in these scripts
> progressively; all you would need to do is to alter the order in which
> that's done.  you might also want to submit a patch or at least
> bugreport to upstream, as i imagine no one's especially wedded to the
> order of those quirks.  

I see this section:

# 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" != "false" ] && 
QUIRKS="$QUIRKS --quirk-dpms-on"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBESTATE_RESTORE" != "false" ] && 
QUIRKS="$QUIRKS --quirk-vbestate-restore"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBEMODE_RESTORE" != "false" ] && 
QUIRKS="$QUIRKS --quirk-vbemode-restore"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VGA_MODE_3" != "false" ] && 
QUIRKS="$QUIRKS --quirk-vga-mode3"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST" != "false" ] && 
QUIRKS="$QUIRKS --quirk-vbe-post"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && 
QUIRKS="$QUIRKS --quirk-radeon-off"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RESET_BRIGHTNESS" != "false" ] && 
QUIRKS="$QUIRKS --quirk-reset-brightness"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_NONE" = "true" ] && QUIRKS="$QUIRKS 
--quirk-none"

but this script requires you to know the value of each of the variables, 
and I haven't been able to find those variables anywhere.  I can usually 
follow bash scripts, but have no experience with C/C++ code, which may 
be where they are set.

Do you know?






More information about the Ubuntu-devel-discuss mailing list