Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 367145 - Power Management Guide outdated for baselayout2
Summary: Power Management Guide outdated for baselayout2
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Vermeulen (RETIRED)
URL: http://www.gentoo.org/doc/en/power-ma...
Whiteboard:
Keywords:
: 370303 (view as bug list)
Depends on:
Blocks: 213988
  Show dependency tree
 
Reported: 2011-05-13 21:42 UTC by Libor Polčák
Modified: 2011-08-17 07:27 UTC (History)
7 users (show)

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


Attachments
pmg_switch_runlevel.sh working with new baselayout (pmg_switch_runlevel.sh,925 bytes, text/plain)
2011-05-15 09:43 UTC, Libor Polčák
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Libor Polčák 2011-05-13 21:42:19 UTC
I use battery runlevel as suggested in Power Management Guide (http://www.gentoo.org/doc/en/power-management-guide.xml). After updating to new baselayout my computer always boots into battery runlevel.

The script /etc/acpi/actions/pmg_switch_runlevel.sh (copied from the guide) exits with:
/etc/acpi/actions/pmg_switch_runlevel.sh: line 29: /var/lib/init.d/softlevel: File or directory does not exists

I believe that the directory /var/lib/init.d/ is gone with new baselayout. However, neither the migration guide (http://www.gentoo.org/doc/en/openrc-migration.xml), nor the http://www.gentoo.org/doc/en/power-management-guide.xml says what replaces the directory.

Reproducible: Always

Steps to Reproduce:
1. Install Gentoo with baselayout1
2. Follow http://www.gentoo.org/doc/en/power-management-guide.xml
3. Follow http://www.gentoo.org/doc/en/openrc-migration.xml
Actual Results:  
/etc/acpi/actions/pmg_switch_runlevel.sh does not find /var/lib/init.d and consequently allways enters battery runlevel

Expected Results:  
/etc/acpi/actions/pmg_switch_runlevel.sh checks if the system indeed runs from battery and switch to battery level accordingly.
Comment 1 nm (RETIRED) gentoo-dev 2011-05-13 23:57:48 UTC
Baselayout/ACPI maintainers: can you guys tell the GDP what we need to do for this guide?
Comment 2 Duncan 2011-05-14 01:16:36 UTC
[User with an Acer Aspire One netbook, here.  I used the gentoo-wiki and other net resources to setup the netbook, but did NOT use Gentoo's Power Management Guide as I didn't end up needing it.]

The Power Management Guide as it exists ATM is rather dated in general.

Laptop-mode-tools (LMT) has evolved from its original purpose of controlling disk activity (only), to be a rather all encompassing set of tools (as the name suggests) for automated wall-power/battery-power migration.  There are LMT modules for all sorts of stuff, to the point that once a user explores and sets up all the LMT modules relevant for his hardware, there's not a whole lot more to do, and the nice part of it is that all the modules have sane defaults, disabled or failing gracefully if the hardware or configuration doesn't support them, enabled with defaults that make sense for both laptop-mode (battery) and plugged-in-mode if the hardware and config is there to do so.  Individual tweaks may be necessary for individual installations, but in general, the package fits in very well with Gentoo's "add the bootscript to the default runlevel and it just works as installed" policy.

So I'd suggest a rewritten Power Management Guide centered around laptop-mode-tools.  Of course in Gentoo, that still means getting all the kernel settings correct, for instance, so that part of the guide will still be there.  Covering the basics of frequency-scaling, etc, is still useful, but I'd recommend doing it in the context of LMT, particularly since this guide is specifically aimed at laptop users (not server users or others interested in wall-power-only power-savings).  Same with ACPI.  Same with display dimming and power management.  Of course LMT still covers disk management.  There's even modules to control sound chips (some of them, more common in laptop/netbook chipsets, at least) and wifi vs ethernet, for instance, in current LMT, not really covered at all in the current guide.

And perhaps the key bit.  Once laptop-mode-tools is appropriately setup, there's now little need for a separate battery runlevel, so I'd suggest dropping that bit entirely, which gets it out of the hair of the openrc folks.  It's certainly still possible some users may still want a battery runlevel, but really, no more so than individual installations might want customized runlevels for other usage, and the generic documentation should cover that, no need to do so in a laptop focused power management guide specifically.

Bottom line, I'd be interested in (and am thus volunteering to) help(ing) with the rewrite.  As I only really have experience with the one netbook (and given my usual verbosity) I'm not sure how effective I'd be at the initial writeup, tho if no one else is interested I might be persuaded to try that too, but I'd certainly be open to reviewing drafts created by others.

Meanwhile, I'd suggest at least a (dated) simple note at the top of the existing guide, to the effect that it's a bit dated and hasn't been rewritten yet for baselayout2/openrc.  "We're working on it."  Perhaps with an address to contact for anyone interested in being CCed on further discussion, and/or a link to this bug.

If there's an off-bug discussion list setup for this, please do CC me, or reply to the bug asking interested people to CC.
Comment 3 Libor Polčák 2011-05-15 09:43:56 UTC
Created attachment 273247 [details]
pmg_switch_runlevel.sh working with new baselayout

Hello again,

I've been working on this issue. I found a rather old Bug 209258 which describe the same issue. I have changed the pmg_switch_runlevel.sh so it works on my computer with baselayout2. See it in the attachment. "rc-status --runlevel" works also in baselayout1 so the proposed script should also work in baselayout1 environment.

I propose to replace pmg_switch_runlevel.sh listed at http://www.gentoo.org/doc/en/power-management-guide.xml with the script from the attachment. In addition, if Duncan thinks that the documentation is outdated it could be improved later.

Libor
Comment 4 Libor Polčák 2011-05-15 10:22:54 UTC
I also think that we should warn users following Gentoo documentation that the old script is broken after the update. IMHO it would be appropriate to list the whole issue in the Baselayout and OpenRC Migration Guide (http://www.gentoo.org/doc/en/openrc-migration.xml).

Libor
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2011-05-15 12:26:13 UTC
(In reply to comment #2)
> Bottom line, I'd be interested in (and am thus volunteering to) help(ing) with
> the rewrite.  As I only really have experience with the one netbook (and given
> my usual verbosity) I'm not sure how effective I'd be at the initial writeup,
> tho if no one else is interested I might be persuaded to try that too, but I'd
> certainly be open to reviewing drafts created by others.

Duncan I think this is great idea! I'll be happy to test your writeup on my laptop, so, please, do, until somebody else has objections or steps in.

Also I agree that this is good idea to mention this breakage in migration guide. Josh can we add reference on this bug into migration bug?
Comment 6 Pacho Ramos gentoo-dev 2011-05-15 13:13:08 UTC
If there is anyway to make laptops to automatically hibernate at low battery using only acpid rules (if possible), I would really appreciate it to be documented also as I wouldn't like to install and run laptop-mode-tools only for this.

Thanks a lot
Comment 7 nm (RETIRED) gentoo-dev 2011-05-15 19:51:21 UTC
(In reply to comment #5)
> Also I agree that this is good idea to mention this breakage in migration
> guide. Josh can we add reference on this bug into migration bug?

It already blocks the tracker bug.

(in reply to everyone else)

Nothing can happen until I see some patches. There have been a lot of changes proposed, but I can't do anything until I see some substantial patches to address those proposals.

I'm against a complete rewrite, because that would take far too much time, and would throw away a lot of perfectly good content. I am in favor of making only the necessary changes to work with OpenRC/baselayout-2, so that's where I would like to see the patches made.
Comment 8 Peter Volkov (RETIRED) gentoo-dev 2011-05-16 07:58:31 UTC
(In reply to comment #7)
> I'm against a complete rewrite, because that would take far too much time, and
> would throw away a lot of perfectly good content.

Josh, that guide was great at time. Currently I think it's better if that content be brought as an alternative way for those who wish to know how it works under the hood, while in case user merely is interested in good power management LMT is really better/easier alternative.

> I am in favor of making only the necessary changes to work with OpenRC/baselayout-2, so
> that's where I would like to see the patches made.

Comment #3 mentions such change and, since it look like Libor is the only one CC'ed to this bug with such setup, easiest solution would be commit that change and live with it until somebody provides better patch (and I'll really appreciate if that patch includes mention of LMT ;) ).
Comment 9 nm (RETIRED) gentoo-dev 2011-06-06 19:15:38 UTC
*** Bug 370303 has been marked as a duplicate of this bug. ***
Comment 10 Chris Slycord 2011-08-15 22:36:36 UTC
For what it's worth, the only thing I needed to change to get the guide working with baselayout2 was to create a .start entry in /etc/local.d/ with the same contents mentioned in the guide for the /etc/conf.d/local.start entry.
Comment 11 Sven Vermeulen (RETIRED) gentoo-dev 2011-08-17 07:02:36 UTC
I'll be updating the guide to reflect OpenRC changes, but not to rewrite it completely. I'll open a new bug for that so someone who wants to take a stab at rewriting it can work there.
Comment 12 Sven Vermeulen (RETIRED) gentoo-dev 2011-08-17 07:27:45 UTC
The document has been updated (in CVS), there was also a mentioning of /etc/modules.autoload.d which doesn't exist anymore either. The pmg_switch_runlevel.sh script is also updated (including the typo in the script itself where "pmg_switch_runleve" was used instead of "pmg_switch_runlevel".

I have created bug #367145 as separate one. OpenRC fixes are currently the most urgent ones to fix so I'd like to finish off those first.

Takers on an updated guide are greatly welcomed of course - doesn't matter which format, as long as we're allowed to put it on the site using the cc-by-sa-2.5 license. Translating towards GuideXML is a no-brainer for some people, so (ab)use those people ;-)