Difference between revisions of "Laptop Mode Tools (简体中文)"

From ArchWiki
Jump to: navigation, search
(疑难问题)
(use https for links to archlinux.org)
Line 17: Line 17:
 
{{Article summary link|Mailing List Archives|http://mailman.samwel.tk/pipermail/laptop-mode/ }}
 
{{Article summary link|Mailing List Archives|http://mailman.samwel.tk/pipermail/laptop-mode/ }}
 
{{Article summary link|Less Watts - Official Site|http://www.lesswatts.org/index.php}}
 
{{Article summary link|Less Watts - Official Site|http://www.lesswatts.org/index.php}}
{{Article summary link|Laptop - ArchWiki|http://wiki.archlinux.org/index.php/Laptop|lll}}
+
{{Article summary link|Laptop - ArchWiki|https://wiki.archlinux.org/index.php/Laptop|lll}}
 
{{Article summary end}}
 
{{Article summary end}}
  

Revision as of 00:49, 6 December 2012

Tango-preferences-desktop-locale.png本页面需要更新翻译,内容可能已经与英文脱节。要贡献翻译,请访问简体中文翻译组Tango-preferences-desktop-locale.png

附注: please use the first argument of the template to provide more detailed indications.

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary heading Template:Article summary link Template:Article summary link Template:Article summary link Template:Article summary link Template:Article summary end

Laptop Mode Tools 是一个 Linux 系统下的笔记本电源管理软件。它是让内核开启笔记本电脑模式功能的主要方法,它会让硬盘降速。另外,它允许你通过一个简单的配置文件调整一些其他的节能相关的设置。

acpidCPU frequency scaling、 和 pm-utils 结合,LMT 提供大多数用户一个完整的笔记本电脑电源管理方案。

安装

laptop-mode-tools 可以从 官方源安装

配置

添加 laptop-mode/etc/rc.conf 中的 DAEMONS 列表:

DAEMONS=(...laptop-mode...)

进行配置可以通过:

  • /etc/laptop-mode/laptop-mode.conf - 基本设置文件
  • /etc/laptop-mode/conf.d/* - 这里有一堆详细功能的设置文件

如果 /etc/laptop-mode/laptop-mode.conf 文件里设置了ENABLE_AUTO_MODULES , LMT 会自动读取 conf.d/* 里的设置.

硬盘

为了使用该功能您需要安装 hdparm 或者 sdparm。 查看 Hdparm.

通过 hdparm -S 命令来降低硬盘转速可以让计算机更省电同时更安静. 即是您正在使用电脑您依然可以使用磁盘预读功能让硬盘经常降低转速。LMT(笔记本电脑工具包)也可以使用hdparm -B 命令。硬盘省电级别最高(最省电)为1,最低是254,使用交流电源供电时默认为254,使用电池供电时默认为1。如果你觉得硬盘减速使得一些操作变慢的话,把它设置为一个高一点的值(比如128)是个好主意,这会让它不会太频繁的减速。 hdparm -Shdparm -B 命令的一些参数设置在 /etc/laptop-mode/laptop-mode.conf文件中。

如果 CONTROL_MOUNT_OPTIONS 选项为 on (默认即为 on), laptop-mode-tools 会自动重新挂载你的分区, 并在挂载选项中增加了 'commit=600,noatime'。这会让磁盘日志程序jbd2每10分钟更新一次磁盘日志,而不是通常情况下的几秒钟更新一次 (注意:使用该设置你可能会丢掉前10分钟的工作成果(当系统意外关闭时)). 同时请确保不要使用 atime 的挂载参数, 使用 noatimerelatime 来替代。

注意: CONTROL_MOUNT_OPTIONS 的值不应该在nilfs2分区上被设置为 on (原因可查看 https://bbs.archlinux.org/viewtopic.php?id=134656) (也可以查看 http://www.ibm.com/developerworks/cn/linux/l-cn-nilfs2/index.html 对nilfs2文件系统的中文介绍)

CPU 频率调节

使用该功能你需要安装调节CPU频率的驱动模块。 查看 CPU Frequency Scaling.

# cpufreq.conf
# ThinkPad T40/T42/T60 Example
#
CONTROL_CPU_FREQUENCY=1
BATT_CPU_MAXFREQ=fastest
BATT_CPU_MINFREQ=slowest
BATT_CPU_GOVERNOR=ondemand
BATT_CPU_IGNORE_NICE_LOAD=1
LM_AC_CPU_MAXFREQ=fastest
LM_AC_CPU_MINFREQ=slowest
LM_AC_CPU_GOVERNOR=ondemand
LM_AC_CPU_IGNORE_NICE_LOAD=1
NOLM_AC_CPU_MAXFREQ=fastest
NOLM_AC_CPU_MINFREQ=slowest
NOLM_AC_CPU_GOVERNOR=ondemand
NOLM_AC_CPU_IGNORE_NICE_LOAD=0
CONTROL_CPU_THROTTLING=0

Device and bus

Intel SATA

  • Enable the Intel SATA AHCI controller Aggressive Link Power Management feature to set the disk link into a very low power mode in the absence of disk IO.
# intel-sata-powermgmt.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_INTEL_SATA_POWER=1
BATT_ACTIVATE_SATA_POWER=1
LM_AC_ACTIVATE_SATA_POWER=1
NOLM_AC_ACTIVATE_SATA_POWER=0
Note: Review the well-documented /etc/laptop-mode/conf.d/intel-sata-powermgmt.conf file for additional configuration details.

USB 自动休眠

# usb-autosuspend.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_USB_AUTOSUSPEND=1
BATT_SUSPEND_USB=1
LM_AC_SUSPEND_USB=1
NOLM_AC_SUSPEND_USB=0
AUTOSUSPEND_TIMEOUT=2
Note: Review the well-documented /etc/laptop-mode/conf.d/usb-autosuspend.conf file for additional configuration details.

显示和图形

LCD 显示器亮度

  • 可以通过以下命令来查看可用的笔记本电脑屏幕亮度数值:
$ cat /proc/acpi/video/VID/LCD/brightness
ThinkPad T40/T42

对于 ThinkPad T40/T42 笔记本,最小和最大亮度的查看要通过以下命令:

$ cat /sys/class/backlight/acpi_video0/brightness
$ cat /sys/class/backlight/acpi_video0/max_brightness
# lcd-brightness.conf
# ThinkPad T40/T42 Example
#
DEBUG=0
CONTROL_BRIGHTNESS=1
BATT_BRIGHTNESS_COMMAND="echo 0"
LM_AC_BRIGHTNESS_COMMAND="echo 7"
NOLM_AC_BRIGHTNESS_COMMAND="echo 7"
BRIGHTNESS_OUTPUT="/sys/class/backlight/thinkpad_screen/brightness"
ThinkPad T60
  • For ThinkPad T60 notebooks, minimum and maximum brightness values can be obtained by running:
$ cat /sys/class/backlight/thinkpad_screen/max_brightness
$ cat /sys/class/backlight/thinkpad_screen/brightness
# lcd-brightness.conf
# ThinkPad T60 Example
#
DEBUG=0
CONTROL_BRIGHTNESS=1
BATT_BRIGHTNESS_COMMAND="echo 0"
LM_AC_BRIGHTNESS_COMMAND="echo 7"
NOLM_AC_BRIGHTNESS_COMMAND="echo 7"
BRIGHTNESS_OUTPUT="/sys/class/backlight/acpi_video0/brightness"

{{注意|更多配置细节请阅读 /etc/laptop-mode/conf.d/lcd-brightness.conf 文件。

Terminal blanking

# terminal-blanking.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_TERMINAL=1
TERMINALS="/dev/tty1"
BATT_TERMINAL_BLANK_MINUTES=1
BATT_TERMINAL_POWERDOWN_MINUTES=2
LM_AC_TERMINAL_BLANK_MINUTES=10
LM_AC_TERMINAL_POWERDOWN_MINUTES=10
NOLM_AC_TERMINAL_BLANK_MINUTES=10
NOLM_AC_TERMINAL_POWERDOWN_MINUTES=10
Note: Review the well-documented /etc/laptop-mode/conf.d/terminal-blanking.conf file for additional configuration details.

网络

以太网

# ethernet.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_ETHERNET=1
LM_AC_THROTTLE_ETHERNET=0
NOLM_AC_THROTTLE_ETHERNET=0
DISABLE_WAKEUP_ON_LAN=1
DISABLE_ETHERNET_ON_BATTERY=1
ETHERNET_DEVICES="eth0"

无线局域网

Wireless interface power management settings are hardware-dependent, and thus a bit trickier to configure. Depending on the wireless chipset, the settings are managed in one of the following three files:

  1. /etc/laptop-mode/conf.d/wireless-power.conf for a generic method of saving power (using "iwconfig wlan0 power on/off"). This applies to most chipsets (that is, anything but Intel chipsets listed below).
  2. /etc/laptop-mode/conf.d/wireless-ipw-power.conf for Intel chipsets driven by the old ipw driver. This apply to IPW3945, IPW2200 and IPW2100. It currently (as of LMT 1.55-1) uses iwpriv for IPW3945, and a combination of iwconfig and iwpriv settings for IPW2100 and IPW220. See /usr/share/laptop-mode-tools/modules/wireless-ipw-power for details. (note that the ipw3945 is not used anymore, see below)
  3. /etc/laptop-mode/conf.d/wireless-iwl-power.conf for Intel chipsets driven by modules iwl4965, iwl3945 and iwlagn (this latter supports chipsets 4965, 5100, 5300, 5350, 5150, 1000, and 6000)

Note that activating the three of them should not be much of a problem, since LMT detects the module used by the interface and acts accordingly.

The supported modules for each configuration file, indicated above, are taken directly from LMT. However, this seems to be a bit out-of-date, since the current 2.6.34 kernel does not provide the ipw3945 and iwl4965 modules anymore (3945 chipset uses iwl3945 instead, and 4965 uses the generic module iwlagn). This is only brought here for information, as this does not (or should not) affect the way LMT works.

There is a known issue with some chipsets running with the iwlagn module (namely, the 5300 chipset, and maybe others). On those chipsets, the following settings of /etc/laptop-mode/conf.d/wireless-iwl-power.conf :

IWL_AC_POWER
IWL_BATT_POWER

are ignored, because the /sys/class/net/wlan*/device/power_level file does not exist. Instead, the standard method (with "iwconfig wlan0 power on/off") is automatically used.

音频设备

AC97

# ac97-powersave.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_AC97_POWER=1

Intel HDA

# intel-hda-powersave.conf
# ThinkPad T40/T42/T60 Example
#
DEBUG=0
CONTROL_INTEL_HDA_POWER=1
BATT_INTEL_HDA_POWERSAVE=1
LM_AC_INTEL_HDA_POWERSAVE=1
NOLM_AC_INTEL_HDA_POWERSAVE=0
INTEL_HDA_DEVICE_TIMEOUT=10
INTEL_HDA_DEVICE_CONTROLLER=0

Tips and tricks

Aliases

lm-profiler

Disabling

疑难问题

Laptop-mode-tools is not picking up events

你需要安装并开启 acpid (简体中文)。 添加 acpid/etc/rc.conf 文件的 DAEMONS 列表 :

DAEMONS=(... acpid ...)

对于使用 systemd (简体中文) 的系统,开启并使其开机自动加载acpid (简体中文) 请运行以下命令(需要root权限):

$ systemctl enable acpid
$ systemctl start acpid

如果这样不管用的话,请仔细检查一边 laptop-mode 的配置文件并确定需要开启的服务被设置成 1 了。许多服务,包括cpu频率控制服务 (cpufreq control) 默认设置都是'自动'("auto"),所以可能没有开启。

I have experienced issues with bluetooth not working if i boot up with battery, and i fixed it with disabling runtime-pm.

连接电源后Laptop-mode-tools并没有停止

这可能是因为同时安装有laptop-mode-tools和pm-utils两个软件包,它们互相会冲突,从而导致laptop-mode-tools不能准确的设定自己的状态。

This can be fixed by disabling scripts with duplicate functionality in pm-utils. The main cause of this is the laptop-mode script located in /usr/lib/pm-utils/power.d. The script can be blacklisted by creating a file in /etc/pm/config.d as follows:

HOOK_BLACKLIST="laptop-mode"

You can also add any other scripts found in /usr/lib/pm-utils/power.d to this list to disable them. I recommend going through and disabling any hook that has equivalent functionality in LMT.