tracking down suspend/hibernate bugs?

Matt Price matt.price at utoronto.ca
Wed Jan 16 01:20:35 UTC 2008


On Tue, 2008-01-15 at 19:18 -0500, Paul S wrote:
> 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)
> 
nice.  so i guess this ocnfirms that the gnome power button uses
pm-utils, but i wish i could see how the hal script is called.  

> >> 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.
> 
i don't see either.  i tried this:
$ dpkg -L hal | xargs grep "HAL_PROP_POWER_MANAGEMENT_QUIRK_S3_BIOS"
but didn't get any helpful hits.  

that shouldn't matter though -- presumably the relevant variables *are*
set, so the quirk gets added; by changing the order of the tests, the
ordering of the quirks also ought to be affected.  give it a try!

matt

> Do you know?
> 
> 
> 
-- 
Matt Price
matt.price at utoronto.ca




More information about the Ubuntu-devel-discuss mailing list