On Mon, Mar 26, 2007 at 09:03:59PM +0200, Tim Dijkstra wrote:
> On Mon, 26 Mar 2007 20:16:41 +0200
> Stefan Seyfried <[EMAIL PROTECTED]> wrote:
> 
> >  do_suspend_hybrid()
> >  {
> > -   return 1
> > +   local RET=1
> > +   if [ -z "$HIBERNATE_METHOD" ]; then
> > +           if [ -x /usr/sbin/s2both -a -c /dev/snapshot ]; then
> > +                   HIBERNATE_METHOD="userspace"
> > +           else
> > +                   HIBERNATE_METHOD="kernel"
> > +           fi
> > +   fi
> 
> This test doens't seem necessary to me, There is no `kernel' method.

Yes, i thought about this, too. But once somebody works on suspend2 support,
there will be a third method for suspend to disk and a second for suspend to
both.

> Also s2both will return an error when configured wrongly so these
> are in a sense done twice...
> 
> > +   case $HIBERNATE_METHOD in
> > +           userspace)
> > +                   set -x
> > +                   /usr/sbin/s2both -f $S2DISK_CONF
> > +                   RET=$?
> > +                   set +x
> > +                   ;;
> > +           *)
> > +                   RET=1
> > +                   ;;
> > +   esac
> > +   return $RET
> >  }
> 
> 
> BTW, in pm-action REVERSE is set as "resume" or "thaw" depending on the
> method. With `hybrid' we can get back from both s2ram or s2disk, did you
> think about what to choose for REVERSE from hybrid?

Somebody will come up with a name, i won't go into naming details. You know,
if it was me, we would not have "suspend" and "hibernate" but technically
correct terms... ;-) I really no longer care about the names, i'll just use
what's implemented.

The "set -x" are indeed for more verbose logging, we could also just put a
line with

                echo "running /usr/sbin/s2both -f '$S2DISK_CONF'"

in there. The set -x is more a quick hack, since i am right now debugging a
report where apparently some config variables are not set correctly (part of
it due to the non-exporting of the variables at the start of functions, as
fixed by my trivial patch yesterday).

We can argue about logging later IMO :-)
-- 
Stefan Seyfried

"Any ideas, John?"
"Well, surrounding them's out." 
_______________________________________________
Pm-utils mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pm-utils

Reply via email to