Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 396703 - app-laptop/laptop-mode-tools: missing pm-utils/sleep.d hook causes no power state check after resume
Summary: app-laptop/laptop-mode-tools: missing pm-utils/sleep.d hook causes no power s...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords: Bug, EBUILD, PATCH
Depends on:
Blocks: 327443 359187
  Show dependency tree
 
Reported: 2012-01-01 17:44 UTC by Ondrej Grover
Modified: 2012-01-16 19:14 UTC (History)
2 users (show)

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


Attachments
proposed resolution for laptop-mode-tools-1.60-r1.ebuild (lap.patch,361 bytes, patch)
2012-01-01 17:56 UTC, Ondrej Grover
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ondrej Grover 2012-01-01 17:44:24 UTC
I opened this bug because I believe that bug bug 327443 did not fix what it was supposed to fix, because upstream is talking about power.d
directory, not sleep.d directory. I'm not sure, what the current policy on wrongly closed bugs is, so please advise if necessary.

Brief description of the problem (for further details visit  bug 327443 )

That upstream note on the pm-utils homepage mentions doubling functionality laptop-mode-tools vs. pm-utils. This 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-*-pm-utils-1.4.0.patch deals with
the hook in the /usr/lib/pm-utils/sleep.d directory which is responsible for re-checking the power state after resume.

And pm-utils don't provide any 99laptop-mode hook in the sleep.d directory
anymore (which is what the patch could theoretically fix), 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 the pm-powersave script is run at the same time as the laptop-mode script (which is unlikely),
these two packages don't actually conflict, however, 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
it should be removed from the laptop-mode-tools ebuild

Reproducible: Always

Steps to Reproduce:
1. install laptop-mode-tools and pm-utils
2. suspend or hibernate using the respective pm-* script
3. resume
Actual Results:  
if one suspends/hibernates on AC power and resumes on battery, this change slips unnoticed and laptop-mode is not triggered by the laptop-mode-tools daemon

Expected Results:  
The power state should be checked after resume. The 01laptop-mode hook in the /etc/pm-utils/sleep.d is responsible for that.

I've reported this already in bug 327443, comment 3 , but there it would go most likely unnoticed.
Comment 1 Ondrej Grover 2012-01-01 17:56:04 UTC
Created attachment 297555 [details, diff]
proposed resolution for laptop-mode-tools-1.60-r1.ebuild

This is my proposed solution: simply remove the useless patch directive from the ebuild and remove the patches in the files subdir
Comment 2 Ondrej Grover 2012-01-11 15:21:56 UTC
The new patch at bug 327443 includes the patch for this bug as I believe both fixes should be included together in the next revbump as these two fixes don't conflict (tested on my setup and logically there is no reason for a conflict).
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2012-01-16 19:14:26 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.