Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 327443 - app-laptop/laptop-mode-tools: pm-utils since >= 1.4.0 has part of the functionality
Summary: app-laptop/laptop-mode-tools: pm-utils since >= 1.4.0 has part of the functio...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on: 396703
Blocks:
  Show dependency tree
 
Reported: 2010-07-08 07:55 UTC by Samuli Suominen (RETIRED)
Modified: 2012-01-16 19:14 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for laptop-mode-tool-1.60-r1.ebuild (lap.patch,915 bytes, patch)
2012-01-11 15:11 UTC, Ondrej Grover
Details | Diff
laptop-mode-tools file to go into /etc/pm/conf.d/ (laptop-mode-tools.pmutils,77 bytes, text/plain)
2012-01-11 15:17 UTC, Ondrej Grover
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuli Suominen (RETIRED) gentoo-dev 2010-07-08 07:55:22 UTC
Source: http://pm-utils.freedesktop.org/wiki/

"We include some basic power management hooks. The individual hooks can conflict with the ones provided by the laptop-mode-tools scripts, so you should either just remove laptop-mode-tools entirely or pick and choose between which package should handle what powersaving functionality. More hooks to handle powersave functionality we do not currently handle are welcome, provided they are general enough to apply across a wide range of use cases."

Source: pm-utils-1.4.1 tarball, ChangeLog:

commit a4e4b0ce456c66d01d9c5f09a73242d2db6c65e9
Author: Victor Lowther <victor.lowther@gmail.com>
Date:   Sat Jun 12 13:07:51 2010 -0500

    Update git tree packaging to conflict with laptop-mode-tools
    
    The new powermanagement scripts conflict with laptop-mode-tools.
    Make sure both are not installed at the same time.
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2010-07-08 07:57:09 UTC
This is now expressed as a !app-laptop/laptop-mode-tools blocker in pm-utils-1.4.1.ebuild, but that's far from optimal. We need to figure a way to strip latest laptop-mode-tools ebuild from the pieces that conflict with pm-utils, and remove the blocker.

Unfortunately I haven't found any specific information about this yet...
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2010-07-08 10:09:53 UTC
Should be fixed with:

   08 Jul 2010; Samuli Suominen <ssuominen@gentoo.org> pm-utils-1.4.1.ebuild:
+  Block only conflicting laptop-mode-tools wrt #327443.

+*laptop-mode-tools-1.55-r1 (08 Jul 2010)
+
+  08 Jul 2010; Samuli Suominen <ssuominen@gentoo.org>
+  +laptop-mode-tools-1.55-r1.ebuild,
+  +files/laptop-mode-tools-1.55-pm-utils-1.4.0.patch:
+  Don't install conflicting pm-utils hooks wrt #327443.

Any feedback is welcome.
Comment 3 Ondrej Grover 2011-12-29 03:24:26 UTC
(In reply to comment #2)
> Should be fixed with:
> 
>    08 Jul 2010; Samuli Suominen <ssuominen@gentoo.org> pm-utils-1.4.1.ebuild:
> +  Block only conflicting laptop-mode-tools wrt #327443.
> 
> +*laptop-mode-tools-1.55-r1 (08 Jul 2010)
> +
> +  08 Jul 2010; Samuli Suominen <ssuominen@gentoo.org>
> +  +laptop-mode-tools-1.55-r1.ebuild,
> +  +files/laptop-mode-tools-1.55-pm-utils-1.4.0.patch:
> +  Don't install conflicting pm-utils hooks wrt #327443.
> 
> Any feedback is welcome.

I believe this "fix" does not fix anything,  upstream is talking about power.d directory, not sleep.d directory. 

That upstream note about doubling functionality refers to the laptop-mode hook in the /usr/lib/pm-utils/power.d/ directory which is run by the pm-powersave script, but that files/laptop-mode-tools-1.55-pm-utils-1.4.0.patch deals with the hook in the hook in the /usr/lib/pm-utils/sleep.d

And pm-utils don't provide any 99laptop-mode hook in the sleep.d directory anymore, so unless we let laptop-mode-tools to install its 01laptop-mode hook into the sleep.d directory, there will be no attempt to recheck the power state after resuming in a different power state.

Proposed resolution:
unless pm-powersave is run at the same time as laptop-mode (which is unlikely), these two packages don't conflict, it may be a good idea to warn the users that they should blacklist the offending hook in power.d if the plan to run both scripts at once


the patch in laptop-mode-tools-1.55-r1 results in loss of functionality, so remove that please
Comment 4 Ondrej Grover 2012-01-11 15:07:59 UTC
Ok, so I was playing around with the pm-utils and laptop-mode-tools combo and I noticed that my HDPARM values set by laptop-mode-tools are disregarded.

It turns out that by default /usr/lib/pm-utils/sleep.d/ contains the 00powersave script which runs the pm-powersave script upon resume from sleep/hibernate.

The pm-powersave script then runs all the scripts in /usr/lib/pm-utils/power.d/, among which are all those offending hooks which then override settings from laptop-mode-tools.

Proposed resolution:
-------------------
Luckily, pm-utils implements an easy blacklisting system, so the solution is to put a file called e.g. laptop-mode-tools into /etc/pm/conf.d/ which contains a line definign the variable HOOK_BLACKLIST. This variable is accumulative and concatenated from all files within the /etc/pm/conf.d/ directory (including the file gentoo that is there by default).

Now the question is what should be blacklisted, either the 00powersave hook which would prevent pm-powersave from running, or just the offending scripts in the /usr/lib/pm-utils/power.d/ directory, e.g. intel-audio-powersave, harddrive, laptop-mode, wireless, ...

I vote for blacklisting the 00powersave hook, because blacklisting only the offending hooks would be hard to maintain in the long-term and we would have to blacklist nearly all those scripts. 

I suggest adding this in the next revbump of laptop-mode-tools which should be rev 1 once bug 396703 is fixed as I believe (and have tested on my setup) that these two fixes don't collide.
Comment 5 Ondrej Grover 2012-01-11 15:11:34 UTC
Created attachment 298651 [details, diff]
patch for laptop-mode-tool-1.60-r1.ebuild

This patch contains ATM both fixes for the next revbump, for bug 39703 (src_prepare part) and the fix for this bug (the src_install part). The laptop-mode-tools.pmutils file will be uploaded next.
Comment 6 Ondrej Grover 2012-01-11 15:13:10 UTC
(In reply to comment #5)

> This patch contains ATM both fixes for the next revbump, for bug 39703
sorry, meant bug 396703
Comment 7 Ondrej Grover 2012-01-11 15:17:10 UTC
Created attachment 298653 [details]
laptop-mode-tools file to go into /etc/pm/conf.d/

This is the file that should be put into /etc/pm/conf.d/ to blacklist the offending 00powersave hook.

As I said in previous comments, blacklisting the hook may be an overkill, but I don't have the time (and IMHO it's not worth it) to check if only some hooks in /usr/lib/pm-utils/power.d/ conflict.
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2012-01-16 19:14:17 UTC
+*laptop-mode-tools-1.60-r1 (16 Jan 2012)
+
+  16 Jan 2012; Samuli Suominen <ssuominen@gentoo.org>
+  +laptop-mode-tools-1.60-r1.ebuild:
+  Stop using -pm-utils-1.4.0.patch and install file containing
+  HOOK_BLACKLIST="00powersave" to /etc/pm/config.d instead wrt #327443 and
+  #396703 by Ondrej Grover. Install 99-laptop-mode.rules to /lib/udev/rules.d
+  instead of /etc/udev/rules.d.