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.
Baselayout/ACPI maintainers: can you guys tell the GDP what we need to do for this guide?
[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.
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
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
(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?
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
(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.
(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 ;) ).
*** Bug 370303 has been marked as a duplicate of this bug. ***
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.
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.
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 ;-)