[Pm-utils] pm-utils 1.2.1 and 1.1.2.5 released

Victor Lowther victor.lowther at gmail.com
Sun Oct 5 17:33:27 PDT 2008


On Mon, 2008-10-06 at 00:31 +0200, Michael Biebl wrote:
> 2008/10/5 Victor Lowther <victor.lowther at gmail.com>:
> > On Sun, 2008-10-05 at 12:45 +0200, Michael Biebl wrote:
> >> 2008/10/4 Victor Lowther <victor.lowther at gmail.com>:
> >
> >
> >> I'd expect that --store-quirks-as-fdi will *only* write the fdi file
> >> and stop afterwards.
> >
> > No, it only writes the file after a sucessful sleep/wake cycle.  Less
> > chance of getting an incorrect .fdi file merged into hal-info that way.
> >
> 
> At first I wanted to agree with you.
> But then I wondered, how do you know, if the suspend/resume cycle was
> successful?

How to I know, or how does pm-utils know?

How pm-utils "knows" is obvious. However, the question does make me want
to add a check to see if we were inhibited in the --store-quirks-as-fdi
logic.

I know becuase the system doesn't lock up an my display came back
without having to do anything else.  Anything else, I would keep
testing.

> A freezing display doesn't necessarily lock up the machine completely,
> so the chance that a fdi file is written is pretty high.

I did say less likely, not impossible.

> The only way to be absolutely certain is, to ask the user after resume.
> But that would make the script interactive....

Making --save-quirks-as-fdi interactive is actually fairly sane. If it
is present, pm-suspend was invoked by the user from a commandline, and
we have every expectation that they should be able to interact by the
time we get around to saving the quirks.

This fugly and insane example is missing a few things (like a timeout),
but it will do the job:

diff --git a/pm/sleep.d/00auto-quirk b/pm/sleep.d/00auto-quirk
index 839c2c0..d382f31 100755
--- a/pm/sleep.d/00auto-quirk
+++ b/pm/sleep.d/00auto-quirk
@@ -20,6 +20,9 @@ do_save_quirks()
        video_vendor=$($hgp system.hardware.primary_video.vendor --hex)
        video_card=$($hgp system.hardware.primary_video.product --hex)
        (
+       printf "%s" "Type 'yes' without the quotes and press Enter: " >$(tty)
+       read v
+       [ "$v" = "yes" ] || return
        exec >"/etc/hal/fdi/information/99local-pm-utils-quirks.fdi"
        echo '<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->'
        echo '<!-- Created by pm-utils -->'

> Cheers,
> Michael
> 
> 
> 
-- 
Victor Lowther
Ubuntu Certified Professional



More information about the Pm-utils mailing list