/[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.21 Revision 1.38
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.21 2006/08/17 00:45:29 rane Exp $ --> 3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.38 2008/09/28 20:29:25 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>
9</author> 9</author>
10<author title="Editor"> 10<author title="Editor">
11 <mail link="chriswhite@gentoo.org">Chris White</mail> 11 <mail link="chriswhite@gentoo.org">Chris White</mail>
12</author> 12</author>
13<author title="Editor">
14 <mail link="nightmorph@gentoo.org">Joshua Saddler</mail>
15</author>
13 16
14<abstract> 17<abstract>
15Power Management is the key to extend battery run time on mobile systems like 18Power Management is the key to extend battery run time on mobile systems like
16laptops. This guide assists you setting it up on your laptop. 19laptops. This guide assists you setting it up on your laptop.
17</abstract> 20</abstract>
18 21
19<!-- 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 -->
20<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 23<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
21<license/> 24<license/>
22 25
23<version>1.28</version> 26<version>1.41</version>
24<date>2006-07-26</date> 27<date>2008-09-28</date>
25 28
26<chapter> 29<chapter>
27<title>Introduction</title> 30<title>Introduction</title>
28<section> 31<section>
29<body> 32<body>
149most out of it. 152most out of it.
150</p> 153</p>
151 154
152<p> 155<p>
153There are different kernel sources in Portage. I'd recommend using 156There are different kernel sources in Portage. I'd recommend using
154<c>gentoo-sources</c> or <c>suspend2-sources</c>. The latter contains patches 157<c>gentoo-sources</c> or <c>tuxonice-sources</c>. The latter contains patches
155for Software Suspend 2, see the chapter about <uri link="#doc_chap7">sleep 158for TuxOnIce, see the chapter about <uri link="#doc_chap7">sleep states</uri>
156states</uri> for more details. When configuring the kernel, activate at least 159for more details. When configuring the kernel, activate at least these options:
157these options:
158</p> 160</p>
159 161
160<pre caption="Minimum kernel setup for Power Management (Kernel 2.6)"> 162<pre caption="Minimum kernel setup for Power Management (Kernel 2.6)">
161Power Management Options ---&gt; 163Power Management Options ---&gt;
162 [*] Power Management Support 164 [*] Power Management Support
331<c>ac_adapter</c> and <c>battery</c> on most laptops, but it might be different 333<c>ac_adapter</c> and <c>battery</c> on most laptops, but it might be different
332on yours. 334on yours.
333</p> 335</p>
334 336
335<pre caption="Determining ACPI events for changing the power source"> 337<pre caption="Determining ACPI events for changing the power source">
336# <i>tail -f /var/log/acpid | grep "received event"</i> 338# <i>tail -f /var/log/messages | grep "received event"</i>
337</pre> 339</pre>
338 340
339<p> 341<p>
340Run the command above and pull the power cable. You should see something like 342Run the command above and pull the power cable. You should see something like
341this: 343this:
605 </ti> 607 </ti>
606</tr> 608</tr>
607<tr> 609<tr>
608 <ti> 610 <ti>
609 <uri 611 <uri
610 link="http://fatcat.ftj.agh.edu.pl/~nelchael/index.php?cat=projs&amp;subcat=ncpufreqd&amp;language=en">ncpufreqd</uri> 612 link="http://projects.simpledesigns.com.pl/project/ncpufreqd/">ncpufreqd</uri>
611 </ti> 613 </ti>
612 <ti>Daemon</ti> 614 <ti>Daemon</ti>
613 <ti>Temperature</ti> 615 <ti>Temperature</ti>
614 <ti>None</ti> 616 <ti>None</ti>
615 <ti>Powersave, performance</ti> 617 <ti>Powersave, performance</ti>
669</pre> 671</pre>
670 672
671<p> 673<p>
672<c>cpufreqd</c> can be configured by editing <path>/etc/cpufreqd.conf</path>. 674<c>cpufreqd</c> can be configured by editing <path>/etc/cpufreqd.conf</path>.
673The default one that ships with cpufreqd may look a bit confusing. I recommend 675The default one that ships with cpufreqd may look a bit confusing. I recommend
674replacing it with the one from Gentoo developer Henrik Brix Andersen (see 676replacing it with the one from former Gentoo developer Henrik Brix Andersen
675below). Please notice that you need cpufreqd-2.0.0 or later. Earlier versions 677(see below). Please notice that you need cpufreqd-2.0.0 or later. Earlier
676have a different syntax for the config file. 678versions have a different syntax for the config file.
677</p> 679</p>
678 680
679<pre caption="/etc/cpufreqd.conf (cpufreqd-2.0.0 and later)"> 681<pre caption="/etc/cpufreqd.conf (cpufreqd-2.0.0 and later)">
680[General] 682[General]
681pidfile=/var/run/cpufreqd.pid 683pidfile=/var/run/cpufreqd.pid
773# <i>watch grep \"cpu MHz\" /proc/cpuinfo</i> 775# <i>watch grep \"cpu MHz\" /proc/cpuinfo</i>
774</pre> 776</pre>
775 777
776<p> 778<p>
777If <path>/proc/cpuinfo</path> doesn't get updated (see <uri 779If <path>/proc/cpuinfo</path> doesn't get updated (see <uri
778link="#doc_chap8">Troubleshooting</uri>), monitor the CPU frequency with: 780link="#doc_chap8">Troubleshooting</uri>), monitor the CPU frequency with
781<c>sys-apps/x86info</c>:
779</p> 782</p>
780 783
781<pre caption="Alternative CPU speed monitoring"> 784<pre caption="Alternative CPU speed monitoring">
782# <i>watch x86info -mhz</i> 785# <i>watch x86info -mhz</i>
783</pre> 786</pre>
819<c>setterm -blank &lt;number-of-minutesM&gt;</c>, <c>setterm -powersave on</c> 822<c>setterm -blank &lt;number-of-minutesM&gt;</c>, <c>setterm -powersave on</c>
820and <c>setterm -powerdown &lt;number-of-minutesM&gt;</c>. For X.org, modify 823and <c>setterm -powerdown &lt;number-of-minutesM&gt;</c>. For X.org, modify
821<path>/etc/X11/xorg.conf</path> similar to this: 824<path>/etc/X11/xorg.conf</path> similar to this:
822</p> 825</p>
823 826
824<pre caption="LCD suspend settings in X.org and XFree86"> 827<pre caption="LCD suspend settings in X.org">
825Section "ServerLayout" 828Section "ServerFlags"
826 Identifier [...]
827 [...]
828 Option "BlankTime" "5" <comment># Blank the screen after 5 minutes (Fake)</comment> 829 Option "blank time" "5" <comment># Blank the screen after 5 minutes (Fake)</comment>
829 Option "StandbyTime" "10" <comment># Turn off screen after 10 minutes (DPMS)</comment> 830 Option "standby time" "10" <comment># Turn off screen after 10 minutes (DPMS)</comment>
830 Option "SuspendTime" "20" <comment># Full suspend after 20 minutes</comment> 831 Option "suspend time" "20" <comment># Full suspend after 20 minutes</comment>
831 Option "OffTime" "30" <comment># Turn off after half an hour</comment> 832 Option "off time" "30" <comment># Turn off after half an hour</comment>
832 [...] 833 [...]
833EndSection 834EndSection
834 835
835[...] 836[...]
836 837
837Section "Monitor" 838Section "Monitor"
838 Identifier [...] 839 Identifier [...]
839 Option "DPMS" "true" 840 Option "DPMS"
840 [...] 841 [...]
841EndSection 842EndSection
842</pre> 843</pre>
843
844<p>
845This is the same for XFree86 and <path>/etc/X11/XF86Config</path>.
846</p>
847 844
848</body> 845</body>
849</section> 846</section>
850<section> 847<section>
851<title>Backlight dimming</title> 848<title>Backlight dimming</title>
855Probably more important is the backlight dimming. If you have access to the 852Probably more important is the backlight dimming. If you have access to the
856dimming settings via a tool, write a small script that dims the backlight in 853dimming settings via a tool, write a small script that dims the backlight in
857battery mode and place it in your <c>battery</c> runlevel. The following script 854battery mode and place it in your <c>battery</c> runlevel. The following script
858should work on most IBM Thinkpads and Toshiba laptops. You've got to enable the 855should work on most IBM Thinkpads and Toshiba laptops. You've got to enable the
859appropriate option in your kernel (IBM Thinkpads only). For Toshiba laptops, 856appropriate option in your kernel (IBM Thinkpads only). For Toshiba laptops,
860install <c>app-laptop/acpitool</c> and skip configuration of <c>ibm_acpi</c> as 857install <c>sys-power/acpitool</c> and skip configuration of <c>thinkpad_acpi</c>
861described below. 858(formerly called <c>ibm_acpi</c>) as described below.
862</p> 859</p>
863 860
864<warn> 861<warn>
865Support for setting brightness is marked experimental in ibm-acpi. It accesses 862Support for setting brightness is marked experimental in thinkpad_acpi. It
866hardware directly and may cause severe harm to your system. Please read the 863accesses hardware directly and may cause severe harm to your system. Please
867<uri link="http://ibm-acpi.sourceforge.net/">ibm-acpi website</uri> 864read the <uri link="http://ibm-acpi.sourceforge.net/">thinkpad_acpi
865website</uri>
868</warn> 866</warn>
869 867
870<p> 868<p>
871To be able to set the brightness level, the ibm_acpi module has to be loaded 869To be able to set the brightness level, the thinkpad_acpi module has to be
872with the experimental parameter. 870loaded with the experimental parameter.
873</p> 871</p>
874 872
875<pre caption="automatically loading the ibm_acpi module"> 873<pre caption="automatically loading the thinkpad_acpi module">
876<comment>(Please read the warnings above before doing this!)</comment> 874<comment>(Please read the warnings above before doing this!)</comment>
877# <i>echo "options ibm_acpi experimental=1" >> /etc/modules.d/ibm_acpi</i> 875# <i>echo "options thinkpad_acpi experimental=1" >> /etc/modprobe.d/thinkpad_acpi</i>
878# <i>/sbin/modules-update</i> 876# <i>update-modules</i>
879# <i>echo ibm_acpi >> /etc/modules.autoload.d/kernel-2.6</i> 877# <i>echo thinkpad_acpi >> /etc/modules.autoload.d/kernel-2.6</i>
880# <i>modprobe ibm_acpi</i> 878# <i>modprobe thinkpad_acpi</i>
881</pre> 879</pre>
882 880
883<p> 881<p>
884This should work without error messages and a file 882This should work without error messages and a file
885<path>/proc/acpi/ibm/brightness</path> should be created after loading the 883<path>/proc/acpi/ibm/brightness</path> should be created after loading the
887the power source. 885the power source.
888</p> 886</p>
889 887
890<pre caption="/etc/conf.d/lcd-brightness"> 888<pre caption="/etc/conf.d/lcd-brightness">
891<comment># See /proc/acpi/ibm/brightness for available values</comment> 889<comment># See /proc/acpi/ibm/brightness for available values</comment>
892<comment># Please read /usr/src/linux/Documentation/ibm-acpi.txt</comment> 890<comment># Please read /usr/src/linux/Documentation/thinkpad-acpi.txt</comment>
893 891
894<comment># brigthness level in ac mode. Default is 7.</comment> 892<comment># brightness level in ac mode. Default is 7.</comment>
895BRIGHTNESS_AC=7 893BRIGHTNESS_AC=7
896 894
897<comment># brightness level in battery mode. Default is 4.</comment> 895<comment># brightness level in battery mode. Default is 4.</comment>
898BRIGHTNESS_BATTERY=4 896BRIGHTNESS_BATTERY=4
899</pre> 897</pre>
919 ebegin "Setting LCD brightness" 917 ebegin "Setting LCD brightness"
920 acpitool -l $LEVEL >/dev/null || ewarn "Unable to set lcd brightness" 918 acpitool -l $LEVEL >/dev/null || ewarn "Unable to set lcd brightness"
921 eend $? 919 eend $?
922 else 920 else
923 ewarn "Setting LCD brightness is not supported." 921 ewarn "Setting LCD brightness is not supported."
924 ewarn "For IBM Thinkpads, check that ibm_acpi is loaded into the kernel" 922 ewarn "For IBM Thinkpads, check that thinkpad_acpi is loaded into the kernel"
925 ewarn "For Toshiba laptops, you've got to install app-laptop/acpitool" 923 ewarn "For Toshiba laptops, you've got to install sys-power/acpitool"
926 fi 924 fi
927} 925}
928 926
929start() { 927start() {
930 set_brightness 928 set_brightness
972<section> 970<section>
973<title>Increasing idle time - laptop-mode</title> 971<title>Increasing idle time - laptop-mode</title>
974<body> 972<body>
975 973
976<p> 974<p>
977Recent kernels (2.6.6 and greater, recent 2.4 ones and others with patches)
978include the so-called <c>laptop-mode</c>. When activated, dirty buffers are 975Recent 2.6 kernels include the so-called <c>laptop-mode</c>. When activated,
979written to disk on read calls or after 10 minutes (instead of 30 seconds). This 976dirty buffers are written to disk on read calls or after 10 minutes (instead of
980minimizes the time the hard disk needs to be spun up. 97730 seconds). This minimizes the time the hard disk needs to be spun up.
981</p> 978</p>
982 979
983<pre caption="Automated start of laptop-mode"> 980<pre caption="Automated start of laptop-mode">
984# <i>emerge laptop-mode-tools</i> 981# <i>emerge laptop-mode-tools</i>
985</pre> 982</pre>
1065<section> 1062<section>
1066<title>hdparm</title> 1063<title>hdparm</title>
1067<body> 1064<body>
1068 1065
1069<p> 1066<p>
1070The second possibility is using a small script and <c>hdparm</c>. Skip this if 1067The second possibility is using <c>hdparm</c>. Skip this if
1071you are using laptop-mode. Otherwise, create <path>/etc/init.d/pmg_hda</path>: 1068you are using laptop-mode. Otherwise, edit <path>/etc/conf.d/hdparm</path> and
1069add the following values to your drive entries. This example assumes your hard
1070drive is called <b>hda</b>:
1072</p> 1071</p>
1073 1072
1074<pre caption="Using hdparm for disk standby"> 1073<pre caption="Using /etc/conf.d/hdparm for disk standby">
1075#!/sbin/runscript 1074hda_args="-q -S12"
1076
1077depend() {
1078after hdparm
1079}
1080
1081start() {
1082ebegin "Activating Power Management for Hard Drives"
1083hdparm -q -S12 /dev/hda
1084eend $?
1085}
1086
1087stop () {
1088ebegin "Deactivating Power Management for Hard Drives"
1089hdparm -q -S253 /dev/hda
1090eend $?
1091}
1092</pre> 1075</pre>
1093 1076
1077<p>
1078This will activate power management for your hard drive. If you ever want to
1079deactivate power management, you can edit <path>/etc/conf.d/hdparm</path> and
1080change the values to <c>-q -S0</c>, or just run <c>hdparm -q -S0 /dev/hda</c>.
1094<p> 1081</p>
1095See <c>man hdparm</c> for the options. If your script is ready, add it to the 1082
1096battery runlevel. 1083<p>
1084See <c>man hdparm</c> for the options. Though you can always start <c>hdparm</c>
1085manually when you are on battery power by running <c>/etc/init.d/hdparm
1086start</c>, it's much easier to automate its startup and shutdown. To do so, add
1087<c>hdparm</c> to the battery runlevel so that it will automatically enable power
1088management.
1097</p> 1089</p>
1098 1090
1099<pre caption="Automate disk standby settings"> 1091<pre caption="Automate disk standby settings">
1100# <i>chmod +x /etc/init.d/pmg_hda</i>
1101# <i>/sbin/depscan.sh</i>
1102# <i>rc-update add pmg_hda battery</i> 1092# <i>rc-update add hdparm battery</i>
1103</pre> 1093</pre>
1104 1094
1105<impo> 1095<impo>
1106Be careful with sleep/spin down settings of your hard drive. Setting it to 1096Be careful with sleep/spin down settings of your hard drive. Setting it to
1107small values might wear out your drive and lose warranty. 1097small values might wear out your drive and lose warranty.
1153<title>Graphics Cards</title> 1143<title>Graphics Cards</title>
1154<body> 1144<body>
1155 1145
1156<p> 1146<p>
1157In case you own an ATI graphics card supporting PowerPlay (dynamic clock 1147In case you own an ATI graphics card supporting PowerPlay (dynamic clock
1158scaling for the the graphics processing unit GPU), you can activate this 1148scaling for the graphics processing unit GPU), you can activate this
1159feature in X.org. Open <path>/etc/X11/xorg.conf</path> and add (or enable) the 1149feature in X.org. Open <path>/etc/X11/xorg.conf</path> and add (or enable) the
1160<c>DynamicClocks</c> option in the Device section. Please notice that this 1150<c>DynamicClocks</c> option in the Device section. Please notice that this
1161feature will lead to crashes on some systems. 1151feature will lead to crashes on some systems.
1162</p> 1152</p>
1163 1153
1174<title>Wireless Power Management</title> 1164<title>Wireless Power Management</title>
1175<body> 1165<body>
1176 1166
1177<p> 1167<p>
1178Wireless LAN cards consume quite a bit of energy. Put them in Power Management 1168Wireless LAN cards consume quite a bit of energy. Put them in Power Management
1179mode in analogy to the <c>pmg_hda</c> script. 1169mode just like your hard drives.
1180</p> 1170</p>
1181 1171
1182<note> 1172<note>
1183This script assumes your wireless interface is called <c>wlan0</c>; replace 1173This script assumes your wireless interface is called <c>wlan0</c>; replace
1184this with the actual name of your interface. 1174this with the actual name of your interface.
1185</note> 1175</note>
1186 1176
1187<pre caption="WLAN Power Management automated">
1188#!/sbin/runscript
1189start() {
1190 ebegin "Activating Power Management for Wireless LAN"
1191 iwconfig wlan0 power on
1192 eend $?
1193}
1194
1195stop () {
1196 ebegin "Deactivating Power Management for Wireless LAN"
1197 iwconfig wlan0 power off
1198 eend $?
1199}
1200</pre>
1201
1202<p>
1203Starting this script will activate power saving features for wlan0. Save it as
1204<path>/etc/init.d/pmg_wlan0</path> and add it to the battery runlevel like the
1205disk script above. See <c>man iwconfig</c> for details and more options like
1206the period between wakeups or timeout settings. If your driver and access point
1207support changing the beacon time, this is a good starting point to save even
1208more energy.
1209</p> 1177<p>
1210 1178Add the following option to <path>/etc/conf.d/net</path> to automatically enable
1211<pre caption="Power Management for WLAN"> 1179power management for your wireless card:
1212# <i>chmod +x /etc/init.d/pmg_wlan0</i>
1213# <i>/sbin/depscan.sh</i>
1214# <i>rc-update add pmg_wlan0 battery</i>
1215</pre> 1180</p>
1181
1182<pre caption="Automated WLAN Power Management">
1183iwconfig_wlan0="power on"
1184</pre>
1185
1186<p>
1187See <c>man iwconfig</c> for details and more options like the period between
1188wakeups or timeout settings. If your driver and access point support changing
1189the beacon time, this is a good starting point to save even more energy.
1190</p>
1216 1191
1217</body> 1192</body>
1218</section> 1193</section>
1219<section> 1194<section>
1220<title>USB Power Management</title> 1195<title>USB Power Management</title>
1291<pre caption="Installing the hibernate-script"> 1266<pre caption="Installing the hibernate-script">
1292# <i>emerge hibernate-script</i> 1267# <i>emerge hibernate-script</i>
1293</pre> 1268</pre>
1294 1269
1295<p> 1270<p>
1296Some configuration has to be done in <path>/etc/hibernate</path> The default 1271Some configuration has to be done in <path>/etc/hibernate</path>. The default
1297package introduces two configuration files <path>hibernate.conf</path> and 1272package introduces a few configuration files for each sleep state. Options that
1298<path>ram.conf</path>. 1273are common to all suspend methods are placed in <path>common.conf</path>; make
1299</p> 1274sure this file is properly set up for your system.
1300
1301<p> 1275</p>
1302To configure sleep, edit <path>ram.conf</path> in <path>/etc/hibernate</path>. 1276
1303<c>UseSysfsPowerState mem</c> is already setup correctly, but you have to go
1304through the rest of the configuration file and set it up for your system. The
1305comments and option names will guide you. If you use nfs or samba shares over
1306the network, make sure to shutdown the appropriate init scripts to avoid
1307timeouts.
1308</p> 1277<p>
1278To configure sleep, edit <path>sysfs-ram.conf</path> in
1279<path>/etc/hibernate</path>. <c>UseSysfsPowerState mem</c> is already setup
1280correctly, but if you need to make further changes to this particular sleep
1281state (or any other sleep state) you should add them to
1282<path>/etc/hibernate/hibernate.conf</path>. The comments and option names will
1283guide you. If you use nfs or samba shares over the network, make sure to
1284shutdown the appropriate init scripts to avoid timeouts.
1285</p>
1286
1287<note>
1288For more information on setting up sleep states, read <c>man
1289hibernate.conf</c>.
1290</note>
1309 1291
1310<p> 1292<p>
1311Ready? Now is the last chance to backup any data you want to keep after 1293Ready? Now is the last chance to backup any data you want to keep after
1312executing the next command. Notice that you probably have to hit a special key 1294executing the next command. Notice that you probably have to hit a special key
1313like <c>Fn</c> to resume from sleep. 1295like <c>Fn</c> to resume from sleep.
1317# <i>hibernate-ram</i> 1299# <i>hibernate-ram</i>
1318</pre> 1300</pre>
1319 1301
1320<p> 1302<p>
1321If you're still reading, it seems to work. You can also setup standby (S1) in a 1303If you're still reading, it seems to work. You can also setup standby (S1) in a
1322similar way by copying <path>ram.conf</path> to <path>standby.conf</path> and 1304similar way by editing <path>sysfs-ram.conf</path> and changing
1323creating a symlink <path>/usr/sbin/hibernate-standby</path> pointing to 1305"UseSysfsPowerState mem" to "UseSysfsPowerState standby". S3 and S4 are the more
1324<path>/usr/sbin/hibernate</path>. S3 and S4 are the more interesting sleep
1325states due to greater energy savings however. 1306interesting sleep states due to greater energy savings however.
1326</p> 1307</p>
1327 1308
1328</body> 1309</body>
1329</section> 1310</section>
1330<section> 1311<section>
1343Shutdown any NFS or samba server/client before hibernating. 1324Shutdown any NFS or samba server/client before hibernating.
1344</warn> 1325</warn>
1345 1326
1346<p> 1327<p>
1347There are two different implementations for S4. The original one is swsusp, 1328There are two different implementations for S4. The original one is swsusp,
1348then there is the newer suspend2 with a nicer interface (including fbsplash 1329then there is the newer tuxonice (former suspend2) with a nicer interface
1349support). A <uri link="http://suspend2.net/features.html#compare"> feature 1330(including fbsplash support). A <uri
1350comparison</uri> is available at the <uri link="http://suspend2.net"> suspend2 1331link="http://tuxonice.net/features.html#compare"> feature comparison</uri> is
1332available at the <uri link="http://www.tuxonice.net">tuxonice Homepage</uri>.
1351Homepage</uri>. There used to be Suspend-to-Disk (pmdisk), a fork of swsusp, 1333There used to be Suspend-to-Disk (pmdisk), a fork of swsusp, but it has been
1352but it has been merged back. 1334merged back.
1353</p>
1354
1355<p> 1335</p>
1336
1337<p>
1356Suspend2 is not included in the mainline kernel yet, therefore you either have 1338TuxOnIce is not included in the mainline kernel yet, therefore you either have
1357to patch your kernel sources with the patches provided by <uri 1339to patch your kernel sources with the patches provided by <uri
1358link="http://suspend2.net">suspend2.net</uri> or use 1340link="http://tuxonice.net">tuxonice.net</uri> or use
1359<c>sys-kernel/suspend2-sources</c>. 1341<c>sys-kernel/tuxonice-sources</c>.
1360</p>
1361
1362<p> 1342</p>
1343
1344<p>
1363The kernel part for both swusp and suspend2 is as follows: 1345The kernel part for both swusp and TuxOnIce is as follows:
1364</p> 1346</p>
1365 1347
1366<pre caption="Kernel configuration for the various suspend types"> 1348<pre caption="Kernel configuration for the various suspend types">
1367Power Management Options ---&gt; 1349Power Management Options ---&gt;
1368 <comment>(hibernate with swsusp)</comment> 1350 <comment>(hibernate with swsusp)</comment>
1369 [*] Software Suspend 1351 [*] Software Suspend
1370 <comment>(replace /dev/SWAP with your swap partition)</comment> 1352 <comment>(replace /dev/SWAP with your swap partition)</comment>
1371 (/dev/SWAP) Default resume partition 1353 (/dev/SWAP) Default resume partition
1372 1354
1373 <comment>(hibernate with suspend2)</comment> 1355 <comment>(hibernate with TuxOnIce)</comment>
1374 Software Suspend 2 1356 Enhanced Hibernation (TuxOnIce)
1375 --- Image Storage (you need at least one writer) 1357 --- Image Storage (you need at least one writer)
1376 [*] File Writer 1358 [*] File Writer
1377 [*] Swap Writer 1359 [*] Swap Writer
1378 --- General Options 1360 --- General Options
1379 [*] LZF image compression 1361 [*] LZF image compression
1395# <i>rc-update add hibernate-cleanup boot</i> 1377# <i>rc-update add hibernate-cleanup boot</i>
1396</pre> 1378</pre>
1397 1379
1398<p> 1380<p>
1399To activate hibernate with swsusp, use the hibernate script and set 1381To activate hibernate with swsusp, use the hibernate script and set
1400<c>UseSysfsPowerState disk</c> in <path>/etc/hibernate/hibernate.conf</path>. 1382<c>UseSysfsPowerState disk</c> in <path>/etc/hibernate/sysfs-disk</path>.
1401</p> 1383</p>
1402 1384
1403<warn> 1385<warn>
1404Backup your data before doing this. Run <c>sync</c> before executing one of the 1386Backup your data before doing this. Run <c>sync</c> before executing one of the
1405commands to have cached data written to disk. First try it outside of X, then 1387commands to have cached data written to disk. First try it outside of X, then
1407</warn> 1389</warn>
1408 1390
1409<p> 1391<p>
1410If you experience kernel panics due to uhci or similar, try to compile USB 1392If you experience kernel panics due to uhci or similar, try to compile USB
1411support as module and unload the modules before sending your laptop to sleep 1393support as module and unload the modules before sending your laptop to sleep
1412mode. There are configuration options for this in <path>hibernate.conf</path> 1394mode. There are configuration options for this in <path>common.conf</path>
1413</p> 1395</p>
1414 1396
1415<pre caption="Hibernating with swsusp"> 1397<pre caption="Hibernating with swsusp">
1416# <i>nano -w /etc/hibernate.conf</i> 1398# <i>nano -w /etc/hibernate/common.conf</i>
1417<comment>(Make sure you have a backup of your data)</comment> 1399<comment>(Make sure you have a backup of your data)</comment>
1418# <i>hibernate</i> 1400# <i>hibernate</i>
1419</pre> 1401</pre>
1420 1402
1421<p> 1403<p>
1422The following section discusses the setup of suspend2 including fbsplash 1404The following section discusses the setup of TuxOnIce including fbsplash support
1423support for a nice graphical progress bar during suspend and resume. 1405for a nice graphical progress bar during suspend and resume.
1424</p> 1406</p>
1425 1407
1426<p> 1408<p>
1427The first part of the configuration is similar to the configuration of swsusp. 1409The first part of the configuration is similar to the configuration of swsusp.
1428In case you didn't store the location of your swap partition in the kernel 1410In case you didn't store the location of your swap partition in the kernel
1429config, you have to pass it as a kernel parameter with the 1411config, you have to pass it as a kernel parameter with the
1430<c>resume2=swap:/dev/SWAP</c> directive. If booting is not possible due to a 1412<c>resume=swap:/dev/SWAP</c> directive. If booting is not possible due to a
1431broken image, append the <c>noresume2</c> parameter. Additionally, the 1413broken image, append the <c>noresume</c> parameter. Additionally, the
1432<c>hibernate-cleanup</c> init script invalidates suspend2 images during the 1414<c>hibernate-cleanup</c> init script invalidates TuxOnIce images during the boot
1433boot process. 1415process.
1434</p> 1416</p>
1435 1417
1436<pre caption="Invalidating suspend2 images during the boot process"> 1418<pre caption="Invalidating TuxOnIce images during the boot process">
1437# <i>rc-update add hibernate-cleanup boot</i> 1419# <i>rc-update add hibernate-cleanup boot</i>
1438</pre> 1420</pre>
1439 1421
1440<p> 1422<p>
1441Now edit <path>/etc/hibernate/hibernate.conf</path>, enable the <c>suspend2</c> 1423Now edit <path>/etc/hibernate/suspend2.conf</path>, enable the <c>TuxOnIce</c>
1442section and comment everything in the <c>sysfs_power_state</c> and 1424options you need. Do not enable the <c>fbsplash</c> options in
1443<c>acpi_sleep</c> sections. Do not enable the <c>fbsplash</c> part in global 1425<c>common.conf</c> just yet.
1444options yet.
1445</p> 1426</p>
1446 1427
1447<pre caption="Hibernating with suspend2"> 1428<pre caption="Hibernating with TuxOnIce">
1448# <i>nano -w /etc/hibernate.conf</i> 1429# <i>nano -w /etc/hibernate/suspend2.conf</i>
1449<comment>(Make sure you have a backup of your data)</comment> 1430<comment>(Make sure you have a backup of your data)</comment>
1450# <i>hibernate</i> 1431# <i>hibernate</i>
1451</pre> 1432</pre>
1452 1433
1453<p> 1434<p>
1454Please configure <c>fbsplash</c> now if you didn't do already. To enable 1435Please configure <c>fbsplash</c> now if you didn't do already. To enable
1455fbsplash support during hibernation, the <c>sys-apps/suspend2-userui</c> 1436fbsplash support during hibernation, the <c>sys-apps/tuxonice-userui</c> package
1456package is needed. Additionally, you've got to enable the <c>fbsplash</c> USE 1437is needed. Additionally, you've got to enable the <c>fbsplash</c> USE flag.
1457flag.
1458</p> 1438</p>
1459 1439
1460<pre caption="Installing suspend2-userui"> 1440<pre caption="Installing tuxonice-userui">
1461# <i>mkdir -p /etc/portage</i>
1462# <i>echo "sys-apps/suspend2-userui fbsplash" >> /etc/portage/package.use</i> 1441# <i>echo "sys-apps/tuxonice-userui fbsplash" >> /etc/portage/package.use</i>
1442<comment>(It may be marked ~arch, so first it must be keyworded)</comment>
1443# <i>echo "sys-apps/tuxonice-userui" >> /etc/portage/package.keywords</i>
1463# <i>emerge suspend2-userui</i> 1444# <i>emerge tuxonice-userui</i>
1464</pre> 1445</pre>
1465 1446
1466<p> 1447<p>
1467The ebuild tells you to make a symlink to the theme you want to use. For 1448The ebuild tells you to make a symlink to the theme you want to use. For
1468example, to use the <c>livecd-2005.1</c> theme, run the following command: 1449example, to use the <c>livecd-2005.1</c> theme, run the following command:
1472# <i>ln -sfn /etc/splash/livecd-2005.1 /etc/splash/suspend2</i> 1453# <i>ln -sfn /etc/splash/livecd-2005.1 /etc/splash/suspend2</i>
1473</pre> 1454</pre>
1474 1455
1475<p> 1456<p>
1476If you don't want a black screen in the first part of the resume process, you 1457If you don't want a black screen in the first part of the resume process, you
1477have to add the <c>suspend2ui_fbsplash</c> tool to your initrd image. Assuming 1458have to add the <c>tuxoniceui_fbsplash</c> tool to your initrd image. Assuming
1478you created the initrd image with <c>splash_geninitramfs</c> and saved it as 1459you created the initrd image with <c>splash_geninitramfs</c> and saved it as
1479<path>/boot/fbsplash-emergence-1024x768</path>, here's how to do that. 1460<path>/boot/fbsplash-emergence-1024x768</path>, here's how to do that.
1480</p> 1461</p>
1481 1462
1482<pre caption="Adding suspend2ui_fbsplash to an initrd image"> 1463<pre caption="Adding tuxoniceui_fbsplash to an initrd image">
1483# <i>mount /boot</i> 1464# <i>mount /boot</i>
1484# <i>mkdir ~/initrd.d</i> 1465# <i>mkdir ~/initrd.d</i>
1485# <i>cp /boot/fbsplash-emergence-1024x768 ~/initrd.d/</i> 1466# <i>cp /boot/fbsplash-emergence-1024x768 ~/initrd.d/</i>
1486# <i>cd ~/initrd.d</i> 1467# <i>cd ~/initrd.d</i>
1487# <i>gunzip -c fbsplash-emergence-1024x768 | cpio -idm --quiet -H newc</i> 1468# <i>gunzip -c fbsplash-emergence-1024x768 | cpio -idm --quiet -H newc</i>
1488# <i>rm fbsplash-emergence-1024x768</i> 1469# <i>rm fbsplash-emergence-1024x768</i>
1489# <i>cp /usr/sbin/suspend2ui_fbsplash sbin/</i> 1470# <i>cp /usr/sbin/tuxoniceui_fbsplash sbin/</i>
1490# <i>find . | cpio --quiet --dereference -o -H newc | gzip -9 > /boot/fbsplash-suspend2-emergence-1024x768</i> 1471# <i>find . | cpio --quiet --dereference -o -H newc | gzip -9 > /boot/fbsplash-tuxonice-emergence-1024x768</i>
1491</pre> 1472</pre>
1492 1473
1493<p> 1474<p>
1494Afterwards adjust <path>grub.conf</path> respectively <path>lilo.conf</path> so 1475Afterwards adjust <path>grub.conf</path> (or <path>lilo.conf</path>) so that
1495that your suspend2 kernel uses 1476your TuxOnIce kernel uses
1496<path>/boot/fbsplash-suspend2-emergence-1024x768</path> as initrd image. You 1477<path>/boot/fbsplash-tuxonice-emergence-1024x768</path> as initrd image. You can
1497can now test a dry run to see if everything is setup correctly. 1478now test a dry run to see if everything is setup correctly.
1498</p> 1479</p>
1499 1480
1500<pre caption="Test run for fbsplash hibernation"> 1481<pre caption="Test run for fbsplash hibernation">
1501# <i>suspend2ui_fbsplash -t</i> 1482# <i>tuxoniceui_fbsplash -t</i>
1502</pre> 1483</pre>
1503 1484
1504<p> 1485<p>
1505Afterwards open <path>/etc/hibernate/hibernate.conf</path> again and activate 1486Afterwards open <path>/etc/hibernate/common.conf</path> and activate the
1506the fbsplash options. Execute <c>hibernate</c> and enjoy. 1487fbsplash options. Execute <c>hibernate</c> and enjoy.
1507</p> 1488</p>
1508 1489
1509</body> 1490</body>
1510</section> 1491</section>
1511</chapter> 1492</chapter>
1522</p> 1503</p>
1523 1504
1524<p> 1505<p>
1525<e>A:</e> Make sure your processor supports CPU frequency scaling and you chose 1506<e>A:</e> Make sure your processor supports CPU frequency scaling and you chose
1526the right CPUFreq driver for your processor. Here is a list of processors that 1507the right CPUFreq driver for your processor. Here is a list of processors that
1527are supported by cpufreq (kernel 2.6.7): ARM Integrator, ARM-SA1100, 1508are supported by cpufreq (kernel 2.6.7): ARM Integrator, ARM-SA1100, ARM-SA1110,
1528ARM-SA1110, AMD Elan - SC400, SC410, AMD mobile K6-2+, AMD mobile K6-3+, AMD 1509AMD Elan - SC400, SC410, AMD mobile K6-2+, AMD mobile K6-3+, AMD mobile Duron,
1529mobile Duron, AMD mobile Athlon, AMD Opteron, AMD Athlon 64, Cyrix Media GXm, 1510AMD mobile Athlon, AMD Opteron, AMD Athlon 64, Cyrix Media GXm, Intel mobile
1530Intel mobile PIII and Intel mobile PIII-M on certain chipsets, Intel Pentium 4, 1511PIII and Intel mobile PIII-M on certain chipsets, Intel Pentium 4, Intel Xeon,
1531Intel Xeon, Intel Pentium M (Centrino), National Semiconductors Geode GX, 1512Intel Pentium M (Centrino), National Semiconductors Geode GX, Transmeta Crusoe,
1532Transmeta Crusoe, VIA Cyrix 3 / C3, UltraSPARC-III, SuperH SH-3, SH-4, several 1513VIA Cyrix 3 / C3, UltraSPARC-III, SuperH SH-3, SH-4, several "PowerBook" and
1533"PowerBook" and "iBook2" and various processors on some ACPI 2.0-compatible 1514"iBook2" and various processors on some ACPI 2.0-compatible systems (only if
1534systems (only if "ACPI Processor Performance States" are available to the 1515"ACPI Processor Performance States" are available to the ACPI/BIOS interface).
1535ACPI/BIOS interface).
1536</p> 1516</p>
1537 1517
1538<p> 1518<p>
1539<e>Q:</e> My laptop supports frequency scaling, but 1519<e>Q:</e> My laptop supports frequency scaling, but
1540<path>/sys/devices/system/cpu/cpu0/cpufreq/</path> is empty. 1520<path>/sys/devices/system/cpu/cpu0/cpufreq/</path> is empty.
1553 1533
1554<p> 1534<p>
1555<e>A:</e> Probably you have activated symmetric multiprocessing support 1535<e>A:</e> Probably you have activated symmetric multiprocessing support
1556(CONFIG_SMP) in your kernel. Deactivate it and it should work. Some older 1536(CONFIG_SMP) in your kernel. Deactivate it and it should work. Some older
1557kernels had a bug causing this. In that case, run <c>emerge x86info</c>, update 1537kernels had a bug causing this. In that case, run <c>emerge x86info</c>, update
1558your kernel as asked and check the current frequency with 1538your kernel as asked and check the current frequency with <c>x86info -mhz</c>.
1559<c>x86info -mhz</c>.
1560</p> 1539</p>
1561 1540
1562<p> 1541<p>
1563<e>Q:</e> I can change the CPU frequency, but the range is not as wide as in 1542<e>Q:</e> I can change the CPU frequency, but the range is not as wide as in
1564another OS. 1543another OS.
1565</p> 1544</p>
1566 1545
1567<p> 1546<p>
1568<e>A:</e> You can combine frequency scaling with ACPI throttling to get a lower 1547<e>A:</e> You can combine frequency scaling with ACPI throttling to get a lower
1569minimum frequency. Notice that throttling doesn't save much energy and is 1548minimum frequency. Notice that throttling doesn't save much energy and is mainly
1570mainly used for thermal management (keeping your laptop cool and quiet). You 1549used for thermal management (keeping your laptop cool and quiet). You can read
1571can read the current throttling state with <c>cat 1550the current throttling state with <c>cat /proc/acpi/processor/CPU/throttling</c>
1572/proc/acpi/processor/CPU/throttling</c> and change it with <c>echo -n "0:x" > 1551and change it with <c>echo -n "0:x" > /proc/acpi/processor/CPU/limit</c>, where
1573/proc/acpi/processor/CPU/limit</c>, where x is one of the Tx states listed in 1552x is one of the Tx states listed in
1574<path>/proc/acpi/processor/CPU/throttling</path>. 1553<path>/proc/acpi/processor/CPU/throttling</path>.
1575</p> 1554</p>
1576 1555
1577<p> 1556<p>
1578<e>Q:</e> When configuring the kernel, powersave, performance and userspace 1557<e>Q:</e> When configuring the kernel, powersave, performance and userspace
1638<e>A:</e> This happens on some systems. You have to disable 1617<e>A:</e> This happens on some systems. You have to disable
1639<c>DynamicClocks</c>. 1618<c>DynamicClocks</c>.
1640</p> 1619</p>
1641 1620
1642<p> 1621<p>
1643<e>Q:</e> I want to use suspend2, but it tells me my swap partition is too 1622<e>Q:</e> I want to use TuxOnIce, but it tells me my swap partition is too
1644small. Resizing is not an option. 1623small. Resizing is not an option.
1645</p> 1624</p>
1646 1625
1647<p> 1626<p>
1648<e>A:</e> If there is enough free space on your system, you can use the 1627<e>A:</e> If there is enough free space on your system, you can use the
1649filewriter instead of the swapwriter. The <c>hibernate-script</c> supports it 1628filewriter instead of the swapwriter. The <c>hibernate-script</c> supports it as
1650as well. More information can be found in 1629well. More information can be found in
1651<path>/usr/src/linux/Documentation/power/suspend2.txt</path>. 1630<path>/usr/src/linux/Documentation/power/tuxonice.txt</path>.
1652</p> 1631</p>
1653 1632
1654<p> 1633<p>
1655<e>Q:</e> I just bought a brand new battery, but it only lasts for some 1634<e>Q:</e> I just bought a brand new battery, but it only lasts for some
1656minutes! What am I doing wrong? 1635minutes! What am I doing wrong?
1686 1665
1687<p> 1666<p>
1688<e>A:</e> Don't fear to contact me, <mail link="earthwings@gentoo.org">Dennis 1667<e>A:</e> Don't fear to contact me, <mail link="earthwings@gentoo.org">Dennis
1689Nienhüser</mail>, directly. The <uri link="http://forums.gentoo.org">Gentoo 1668Nienhüser</mail>, directly. The <uri link="http://forums.gentoo.org">Gentoo
1690Forums</uri> are a good place to get help as well. If you prefer IRC, try the 1669Forums</uri> are a good place to get help as well. If you prefer IRC, try the
1691<c>#gentoo-laptop</c> channel at <uri 1670<c>#gentoo-laptop</c> <uri link="irc://irc.gentoo.org">channel</uri>.
1692link="irc://irc.freenode.net">irc.freenode.net</uri>.
1693</p> 1671</p>
1694 1672
1695</body> 1673</body>
1696</section> 1674</section>
1697</chapter> 1675</chapter>

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.38

  ViewVC Help
Powered by ViewVC 1.1.20