[Pm-utils] pm-utils on suse 10.2 and suspend2

Stefan Seyfried seife at suse.de
Sun Jan 7 22:48:52 PST 2007


On Sun, Jan 07, 2007 at 05:15:28PM -0800, Alexy Khrabrov wrote:
> SuSE has elaborate scripts for pm-utils, with config in
> /etc/pm/config, and the helper functions for powersave in
> /usr/lib/powersave include suspend2.
> 
> What I'd like to do is to interpret the powerbutton push as a command
> to use suspend2, and then it will do whatever hibernate sees as
> PowerdownMethod.

Yes, but this was always more or less a quick hack, since powersaved
had already almost all the infrastructure for suspend, but that
got bypassed in the case of suspend2 and the hibernate script
was called instead (if i remember this correct).

> Apparently, the old scripts mentioned on the 'net for /etc/acpi are no
> longer used, and config for acpi refers to clients for interpretation
> of actions.  Then /etc/powersave says it's also deprecated in favor of
> /etc/pm/config.

In fact, we just did not get ready in time for removing most of the remaining
powersaved bits before 10.2, and the timing of the pm-utils development was
not really in our favour, so we were not sure if it really would be as usable
as it is in time, so we left the powersaved option in :-)

> So what's the right way to integrate suspend2 with SUSE 10.2 and make
> it interpret power events such as button push via calling hibernate?

Here you are mixing things up.
pm-utils does not interpret power events or anything, it just executes
the suspend. The interpretation of the button events etc is now done by the
desktop applets, such as gnome-power-manager or kpowersave. Unfortunately,
kpowersave, as shipped with 10.2 was still missing this feature. So you
either have to wait for the upcoming online update or use gnome-power-manager
until kpowersave is ready.

On the pm-utils side, you just have to patch the suspend2-specific stuff
into the hooks in /etc/pm/hooks and into /etc/pm/functions.
The hooks you need to touch are (probably, educated guess)

	30s2disk-check
	99zzgrub
and the do_hibernate() function in /etc/pm/functions, maybe
/usr/sbin/pm-action will need some love, too.

If you submit patches back here, i can integrate them (but note that there
are already some patches in the SUSE version of pm-utils, you might be better
off taking a fresh CVS checkout of pm-utils and working on that, this will
make the process of getting the patches back upstream easier).


You can of course just call /sbin/hibernate from a hook, but then using
pm-utils is pretty pointless, just deinstall it (and powersaved), and HAL
should fall back to /sbin/hibernate automatically (IIRC).

Have fun :-)

-- 
Stefan Seyfried
QA / R&D Team Mobile Devices        |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg  | "Well, surrounding them's out." 


More information about the Pm-utils mailing list