From: "Stefano Rossi" <so@lark.gentoo.org>
To: gentoo-doc-cvs@lists.gentoo.org
Subject: [gentoo-doc-cvs] cvs commit: power-management-guide.xml
Date: Fri, 28 Oct 2005 14:48:06 +0000 [thread overview]
Message-ID: <200510281448.j9SEm7cY005181@robin.gentoo.org> (raw)
so 05/10/28 14:48:06
Modified: xml/htdocs/doc/en power-management-guide.xml
Log:
#106878 update for this guide
Revision Changes Path
1.15 +409 -157 xml/htdocs/doc/en/power-management-guide.xml
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/power-management-guide.xml?rev=1.15&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/power-management-guide.xml?rev=1.15&content-type=text/plain&cvsroot=gentoo
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/power-management-guide.xml.diff?r1=1.14&r2=1.15&cvsroot=gentoo
Index: power-management-guide.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- power-management-guide.xml 10 Jun 2005 18:45:21 -0000 1.14
+++ power-management-guide.xml 28 Oct 2005 14:48:06 -0000 1.15
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding="UTF-8"?>
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.14 2005/06/10 18:45:21 swift Exp $ -->
-<guide link="power-management-guide.xml">
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.15 2005/10/28 14:48:06 so Exp $ -->
+<guide link="/doc/en/power-management-guide.xml">
<title>Power Management Guide</title>
<author title="Author">
@@ -14,11 +14,11 @@
</abstract>
<!-- The content of this document is licensed under the CC-BY-SA license -->
-<!-- See http://creativecommons.org/licenses/by-sa/2.0 -->
+<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
<license/>
-<version>1.24</version>
-<date>2005-06-10</date>
+<version>1.25</version>
+<date>2005-10-02</date>
<chapter>
<title>Introduction</title>
@@ -27,7 +27,7 @@
<body>
<p>
-Capacity and lifetime of laptop batteries has improved much in the last years.
+Capacity and lifetime of laptop batteries have improved much in the last years.
Nevertheless modern processors consume much more energy than older ones and
each laptop generation introduces more devices hungry for energy. That's why
Power Management is more important than ever. Increasing battery run time
@@ -58,16 +58,16 @@
The <e>Prerequisites</e> chapter talks about some requirements that should be
met before any of the following device individual sections will work. This
includes BIOS settings, kernel configuration and some simplifications in user
-land. The following three chapters focus on devices that typically consume most
-energy - processor, display and hard drive. Each can be configured seperately.
-<e>CPU Power Management</e> shows how to adjust the processor's frequency to
-save a maximum of energy whithout losing too much performance. A few different
-tricks prevent your hard drive from working unnecessarily often in <e>Disk Power
-Management</e> (decreasing noise level as a nice side effect). Some notes on
-Wireless LAN and USB finish the device section in <e>Power Management for other
-devices</e> while another chapter is dedicated to the (rather experimental)
-<e>sleep states</e>. Last not least <e>Troubleshooting</e> lists common
-pitfalls.
+land. The following three chapters focus on devices that typically consume
+most energy - processor, display and hard drive. Each can be configured
+seperately. <e>CPU Power Management</e> shows how to adjust the processor's
+frequency to save a maximum of energy whithout losing too much performance. A
+few different tricks prevent your hard drive from working unnecessarily often
+in <e>Disk Power Management</e> (decreasing noise level as a nice side
+effect). Some notes on graphics cards, Wireless LAN and USB finish the device
+section in <e>Power Management for other devices</e> while another chapter is
+dedicated to the (rather experimental) <e>sleep states</e>. Last not least
+<e>Troubleshooting</e> lists common pitfalls.
</p>
</body>
@@ -135,42 +135,55 @@
</p>
<p>
-In kernel config, activate at least these options:
+There are different kernel sources in Portage. I'd recommend using
+<c>gentoo-sources</c> or <c>suspend2-sources</c>. The latter contains patches
+for Software Suspend 2, see the chapter about sleep states for details. When
+configuring the kernel, activate at least these options:
</p>
<pre caption="Minimum kernel setup for Power Management (Kernel 2.6)">
Power Management Options --->
[*] Power Management Support
[ ] Software Suspend
- [ ] Suspend-to-Disk Support
ACPI( Advanced Configuration and Power Interface ) Support --->
[*] ACPI Support
[ ] Sleep States
+ [ ] /proc/acpi/sleep (deprecated)
[*] AC Adapter
[*] Battery
<M> Button
+ <M> Video
+ [ ] Generic Hotkey
<M> Fan
<M> Processor
<M> Thermal Zone
< > ASUS/Medion Laptop Extras
+ < > IBM ThinkPad Laptop Extras
< > Toshiba Laptop Extras
+ (0) Disable ACPI for systems before Jan 1st this year
[ ] Debug Statements
+ [*] Power Management Timer Support
+ < > ACPI0004,PNP0A05 and PNP0A06 Container Driver (EXPERIMENTAL)
CPU Frequency Scaling --->
[*] CPU Frequency scaling
+ [ ] Enable CPUfreq debugging
+ < > CPU frequency translation statistics
+ [ ] CPU frequency translation statistics details
Default CPUFreq governor (userspace)
<*> 'performance' governor
<*> 'powersave' governor
<*> 'ondemand' cpufreq policy governor
+ <*> 'conservative' cpufreq governor
<*> CPU frequency table helpers
<M> ACPI Processor P-States driver
<*> <i>CPUFreq driver for your processor</i>
</pre>
<p>
-Decide yourself whether you want to enable Software Suspend, Suspend-to-Disk and
-Sleep States (see below). If you own an ASUS, Medion or Toshiba laptop, enable
+Decide yourself whether you want to enable Software Suspend, and Sleep States
+(see below). If you own an ASUS, Medion, IBM Thinkpad or Toshiba laptop, enable
the appropriate section.
</p>
@@ -237,8 +250,25 @@
<p>
Typical ACPI events are closing the lid, changing the power source or pressing
the sleep button. An important event is changing the power source, which should
-cause a runlevel switch. Create the following files to switch between
-<e>default</e> and <e>battery</e> runlevel depending on the power source:
+cause a runlevel switch. A small script will take care of it.
+</p>
+
+<p>
+First you need a script which changes the runlevel to <c>default</c>
+respectively <c>battery</c> depending on the power source. The script uses the
+<c>on_ac_power</c> command from <c>sys-power/powermgmt-base</c> - make sure the
+package is installed on your system.
+</p>
+
+<pre caption="Installing powermgt-base">
+<i># emerge powermgmt-base</i>
+</pre>
+
+<p>
+You are now able to determine the power source by executing
+<c>on_ac_power && echo AC available || echo Running on batteries</c> in
+a shell. The script below is responsible for changing runlevels. Save it as
+<path>/etc/acpi/actions/pmg_switch_runlevel.sh</path>.
</p>
<pre caption="/etc/acpi/actions/pmg_switch_runlevel.sh">
@@ -276,29 +306,56 @@
fi
</pre>
+<p>
+Dont forget to run <c>chmod +x /etc/acpi/actions/pmg_switch_runlevel.sh</c> to
+make the script executable. The last thing that needs to be done is calling the
+script whenever the power source changes. That's done by catching ACPI events
+with the help of <c>acpid</c>. First you need to know which events are
+generated when the power source changes. The events are called
+<e>ac_adapter</e> and <e>battery</e> on most laptops, but it might be different
+on yours.
+</p>
+
+<pre caption="Determining ACPI events for changing the power source">
+<i># tail -f /var/log/acpid | grep "received event"</i>
+</pre>
+
+<p>
+Run the command above and pull the power cable. You should see something
+like this:
+</p>
+
+<pre caption="Sample output for power source changes">
+[Tue Sep 20 17:39:06 2005] received event "ac_adapter AC 00000080 00000000"
+[Tue Sep 20 17:39:06 2005] received event "battery BAT0 00000080 00000001"
+</pre>
+
+<p>
+The interesting part is the quoted string after <e>received event</e>. It will
+be matched by the event line in the files you are going to create below. Don't
+worry if your system generates multiple events or always the same. As long as
+any event is generated, runlevel changing will work.
+</p>
+
<pre caption="/etc/acpi/events/pmg_ac_adapter">
<comment># replace "ac_adapter" below with the event generated on your laptop</comment>
-<comment># See /var/log/acpid</comment>
+<comment># For example, ac_adapter.* will match ac_adapter AC 00000080 00000000</comment>
event=ac_adapter.*
action=/etc/acpi/actions/pmg_switch_runlevel.sh %e
</pre>
--
gentoo-doc-cvs@gentoo.org mailing list
next reply other threads:[~2005-10-28 14:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-28 14:48 Stefano Rossi [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-02-12 11:53 [gentoo-doc-cvs] cvs commit: power-management-guide.xml Josh Saddler
2006-02-16 18:45 Josh Saddler
2006-07-27 8:13 Lukasz Damentko
2006-07-27 8:23 Lukasz Damentko
2006-08-17 0:45 Lukasz Damentko
2006-10-23 3:40 Josh Saddler
2006-12-17 3:42 Josh Saddler
2007-02-20 17:44 Josh Saddler
2007-03-15 19:24 Josh Saddler
2007-05-30 19:09 Josh Saddler
2007-07-08 7:48 Josh Saddler
2007-07-08 17:51 Josh Saddler
2007-07-24 22:32 Josh Saddler
2007-10-03 17:27 Josh Saddler
2007-12-03 19:31 Sven Vermeulen
2008-01-21 12:12 Jan Kundrat
2008-01-21 12:15 Jan Kundrat
2008-01-31 23:38 Joshua Saddler
2008-05-23 20:34 Sven Vermeulen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200510281448.j9SEm7cY005181@robin.gentoo.org \
--to=so@lark.gentoo.org \
--cc=docs-team@lists.gentoo.org \
--cc=gentoo-doc-cvs@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox