/[gentoo]/xml/htdocs/doc/en/power-management-guide.xml
Gentoo

Diff of /xml/htdocs/doc/en/power-management-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.27 Revision 1.28
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.27 2007/05/30 19:09:04 nightmorph Exp $ --> 3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.28 2007/07/08 07:48:12 nightmorph Exp $ -->
4<guide link="/doc/en/power-management-guide.xml"> 4<guide link="/doc/en/power-management-guide.xml">
5<title>Power Management Guide</title> 5<title>Power Management Guide</title>
6 6
7<author title="Author"> 7<author title="Author">
8 <mail link="earthwings@gentoo.org">Dennis Nienhüser</mail> 8 <mail link="earthwings@gentoo.org">Dennis Nienhüser</mail>
21 21
22<!-- The content of this document is licensed under the CC-BY-SA license --> 22<!-- The content of this document is licensed under the CC-BY-SA license -->
23<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 23<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
24<license/> 24<license/>
25 25
26<version>1.33</version> 26<version>1.34</version>
27<date>2007-05-30</date> 27<date>2007-07-08</date>
28 28
29<chapter> 29<chapter>
30<title>Introduction</title> 30<title>Introduction</title>
31<section> 31<section>
32<body> 32<body>
1067<section> 1067<section>
1068<title>hdparm</title> 1068<title>hdparm</title>
1069<body> 1069<body>
1070 1070
1071<p> 1071<p>
1072The second possibility is using a small script and <c>hdparm</c>. Skip this if 1072The second possibility is using <c>hdparm</c>. Skip this if
1073you are using laptop-mode. Otherwise, create <path>/etc/init.d/pmg_hda</path>: 1073you are using laptop-mode. Otherwise, edit <path>/etc/conf.d/hdparm</path> and
1074add the following values to your drive entries. This example assumes your hard
1075drive is called <b>hda</b>:
1074</p> 1076</p>
1075 1077
1076<pre caption="Using hdparm for disk standby"> 1078<pre caption="Using /etc/conf.d/hdparm for disk standby">
1077#!/sbin/runscript 1079hda_args="-q -S12"
1078
1079depend() {
1080after hdparm
1081}
1082
1083start() {
1084ebegin "Activating Power Management for Hard Drives"
1085hdparm -q -S12 /dev/hda
1086eend $?
1087}
1088
1089stop () {
1090ebegin "Deactivating Power Management for Hard Drives"
1091hdparm -q -S253 /dev/hda
1092eend $?
1093}
1094</pre> 1080</pre>
1095 1081
1082<p>
1083This will activate power management for your hard drive. If you ever want to
1084deactivate power management, you can edit <path>/etc/conf.d/hdparm</path> and
1085change the values to <c>-q -S0</c>, or just run <c>hdparm -q -S0 /dev/hda</c>.
1096<p> 1086</p>
1097See <c>man hdparm</c> for the options. If your script is ready, add it to the 1087
1098battery runlevel. 1088<p>
1089See <c>man hdparm</c> for the options. Though you can always start <c>hdparm</c>
1090manually when you are on battery power by running <c>/etc/init.d/hdparm
1091start</c>, it's much easier to automate its startup and shutdown. To do so, add
1092<c>hdparm</c> to the battery runlevel so that it will automatically enable power
1093management.
1099</p> 1094</p>
1100 1095
1101<pre caption="Automate disk standby settings"> 1096<pre caption="Automate disk standby settings">
1102# <i>chmod +x /etc/init.d/pmg_hda</i>
1103# <i>/sbin/depscan.sh</i>
1104# <i>rc-update add pmg_hda battery</i> 1097# <i>rc-update add hdparm battery</i>
1105</pre> 1098</pre>
1106 1099
1107<impo> 1100<impo>
1108Be careful with sleep/spin down settings of your hard drive. Setting it to 1101Be careful with sleep/spin down settings of your hard drive. Setting it to
1109small values might wear out your drive and lose warranty. 1102small values might wear out your drive and lose warranty.
1176<title>Wireless Power Management</title> 1169<title>Wireless Power Management</title>
1177<body> 1170<body>
1178 1171
1179<p> 1172<p>
1180Wireless LAN cards consume quite a bit of energy. Put them in Power Management 1173Wireless LAN cards consume quite a bit of energy. Put them in Power Management
1181mode in analogy to the <c>pmg_hda</c> script. 1174mode just like your hard drives.
1182</p> 1175</p>
1183 1176
1184<note> 1177<note>
1185This script assumes your wireless interface is called <c>wlan0</c>; replace 1178This script assumes your wireless interface is called <c>wlan0</c>; replace
1186this with the actual name of your interface. 1179this with the actual name of your interface.
1187</note> 1180</note>
1188 1181
1189<pre caption="WLAN Power Management automated">
1190#!/sbin/runscript
1191start() {
1192 ebegin "Activating Power Management for Wireless LAN"
1193 iwconfig wlan0 power on
1194 eend $?
1195}
1196
1197stop () {
1198 ebegin "Deactivating Power Management for Wireless LAN"
1199 iwconfig wlan0 power off
1200 eend $?
1201}
1202</pre>
1203
1204<p>
1205Starting this script will activate power saving features for wlan0. Save it as
1206<path>/etc/init.d/pmg_wlan0</path> and add it to the battery runlevel like the
1207disk script above. See <c>man iwconfig</c> for details and more options like
1208the period between wakeups or timeout settings. If your driver and access point
1209support changing the beacon time, this is a good starting point to save even
1210more energy.
1211</p> 1182<p>
1212 1183Add the following script to <path>/etc/conf.d/net</path> to automatically enable
1213<pre caption="Power Management for WLAN"> 1184power management for your wireless card:
1214# <i>chmod +x /etc/init.d/pmg_wlan0</i>
1215# <i>/sbin/depscan.sh</i>
1216# <i>rc-update add pmg_wlan0 battery</i>
1217</pre> 1185</p>
1186
1187<pre caption="Automated WLAN Power Management">
1188iwconfig_wlan0="power on"
1189</pre>
1190
1191<p>
1192See <c>man iwconfig</c> for details and more options like the period between
1193wakeups or timeout settings. If your driver and access point support changing
1194the beacon time, this is a good starting point to save even more energy.
1195</p>
1218 1196
1219</body> 1197</body>
1220</section> 1198</section>
1221<section> 1199<section>
1222<title>USB Power Management</title> 1200<title>USB Power Management</title>

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.20