neysx 05/05/04 16:54:18 Modified: xml/htdocs/doc/en power-management-guide.xml Log: #91043 introduce cpufrequtils for easier problem detection...
Revision Changes Path 1.12 +215 -208 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.12&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.12&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.11&r2=1.12&cvsroot=gentoo Index: power-management-guide.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- power-management-guide.xml 18 Apr 2005 19:19:27 -0000 1.11 +++ power-management-guide.xml 4 May 2005 16:54:18 -0000 1.12 @@ -1,6 +1,6 @@ <?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.11 2005/04/18 19:19:27 dertobi123 Exp $ --> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.12 2005/05/04 16:54:18 neysx Exp $ --> <guide link="power-management-guide.xml"> <title>Power Management Guide</title> @@ -17,15 +17,13 @@ <!-- See http://creativecommons.org/licenses/by-sa/2.0 --> <license/> -<version>1.21</version> -<date>2005-04-18</date> +<version>1.22</version> +<date>2005-05-04</date> <chapter> <title>Introduction</title> - <section> <title>Why Power Management?</title> - <body> <p> @@ -149,8 +147,8 @@ ACPI( Advanced Configuration and Power Interface ) Support ---> [*] ACPI Support [ ] Sleep States - <M> AC Adapter - <M> Battery + [*] AC Adapter + [*] Battery <M> Button <M> Fan <M> Processor @@ -173,9 +171,7 @@ <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 -the appropriate section. Recent kernel versions (2.6.9 and later) include an -<e>'ondemand' governor</e> for CPU Frequency Scaling, activate it as well when -using such a kernel. +the appropriate section. </p> <p> @@ -190,15 +186,14 @@ Compile your kernel, make sure the right modules get loaded at startup and boot into your new ACPI-enabled kernel. Next run <c>emerge sys-power/acpid</c> to get the acpi daemon. This one informs you about events like switching from AC to -battery or closing the lid. Make sure the module <e>button</e> is loaded if you -didn't compile it into the kernel and start acpid with <c>/etc/init.d/acpid -start</c>. Run <c>rc-update add acpid default</c> to load it on startup. You'll -soon see how to use it. +battery or closing the lid. Make sure the modules are loaded if you didn't +compile them into the kernel and start acpid by executing +<c>/etc/init.d/acpid start</c>. Run <c>rc-update add acpid default</c> to load +it on startup. You'll soon see how to use it. </p> <pre caption="Installing acpid"> # <i>emerge sys-power/acpid</i> -# <i>modprobe button</i> # <i>/etc/init.d/acpid start</i> # <i>rc-update add acpid default</i> </pre> @@ -246,83 +241,64 @@ <e>default</e> and <e>battery</e> runlevel depending on the power source: </p> -<pre caption="/etc/acpi/switch_runlevel.sh"> +<pre caption="/etc/acpi/actions/pmg_switch_runlevel.sh"> #!/bin/bash +<comment># BEGIN configuration</comment> RUNLEVEL_AC="default" RUNLEVEL_BATTERY="battery" +<comment># END configuration</comment> -function on_ac () { - if which on_ac_power &> /dev/null - then - on_ac_power - else - grep --quiet on-line /proc/acpi/ac_adapter/*/state - fi -} - -function SwitchRunlevel () { - if [ ! -d "/etc/runlevels/${RUNLEVEL_AC}" ] - then +if [ ! -d "/etc/runlevels/${RUNLEVEL_AC}" ] +then logger "${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting." exit 1 - fi - +fi - if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY}" ] - then +if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY}" ] +then logger "${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborting." exit 1 - fi +fi - if on_ac - then if [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_AC}" ]] +if on_ac_power +then + if [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_AC}" ]] then logger "Switching to ${RUNLEVEL_AC} runlevel" /sbin/rc ${RUNLEVEL_AC} fi - elif [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_BATTERY}" ]] - then +elif [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_BATTERY}" ]] +then logger "Switching to ${RUNLEVEL_BATTERY} runlevel" /sbin/rc ${RUNLEVEL_BATTERY} - fi -} +fi </pre> <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> event=ac_adapter.* -action=/etc/acpi/actions/pmg_ac_adapter.sh %e +action=/etc/acpi/actions/pmg_switch_runlevel.sh %e </pre> <pre caption="/etc/acpi/events/pmg_battery"> +<comment># replace "battery" below with the event generated on your laptop</comment> +<comment># See /var/log/acpid</comment> event=battery.* -action=/etc/acpi/actions/pmg_battery.sh %e -</pre> - -<pre caption="/etc/acpi/actions/pmg_ac_adapter.sh"> -#!/bin/bash - -source /etc/acpi/switch_runlevel.sh -SwitchRunlevel -</pre> - -<pre caption="/etc/acpi/actions/pmg_battery.sh"> -#!/bin/bash - -source /etc/acpi/switch_runlevel.sh -SwitchRunlevel +action=/etc/acpi/actions/pmg_switch_runlevel.sh %e </pre> <p> -Some of these files must be executable. Last not least restart acpid to have -it recognize the changes. +Additionally you need the package sys-power/powermgmt-base which contains +the <c>on_ac_power</c> utility. The file <path>pmg_switch_runlevel.sh</path> +must be executable. </p> <pre caption="Finishing runlevel switching with acpid"> <i># emerge powermgmt-base</i> -<i># chmod +x /etc/acpi/switch_runlevel.sh</i> -<i># chmod +x /etc/acpi/actions/pmg_*</i> +<i># chmod +x /etc/acpi/actions/pmg_switch_runlevel.sh</i> <i># /etc/init.d/acpid restart</i> </pre> @@ -344,7 +320,7 @@ <pre caption="Runlevel switch at boot time by editing local.start"> <comment># Fake acpi event to switch runlevel if running on batteries</comment> -/etc/acpi/actions/pmg_battery.sh "battery/battery" +/etc/acpi/actions/pmg_switch_runlevel.sh "battery/battery" </pre> <p> @@ -373,7 +349,7 @@ it's important to choose the right one in your kernel. You should already have done it above. Once the kernel knows how to change frequencies, it has to know which frequency it should set. This is done according to the <e>policy</e> which -consists of <e>CPUfreq policy</e> and a <e>governor</e>. A CPUfreq policy are <<Truncated>> -- [email protected] mailing list
