Laptop (简体中文) - ArchWiki

# Laptop (简体中文)

本页面需要更新翻译，内容可能已经与英文脱节。要贡献翻译，请访问简体中文翻译组。

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

## 配置笔记本电脑

本文链接到很多其它页面，它们包含把笔记本电脑配置为最佳体验所需的配置。配置笔记本电脑大体上和配置台式机相同，然而，还是会有一些差别。当在笔记本电脑上安装Arch Linux时，下面几项是需要注意的：

- #电源管理。电量消耗（怎么尽量延长电池续航时间）？
  - #待机休眠[broken link: invalid section]。如何使笔记本电脑进入待机和休眠状态？
  - #硬盘停转。在计算机不活动多长时间以后，使硬盘停转？
  - 关闭屏幕。在计算机不活动多长时间以后，关闭屏幕？（不只是启动屏保，而是完全关闭屏幕）

- 屏幕亮度。如何调节屏幕亮度？
- 无线网络。如何配置和连接无线网络？无线网络问题参见Wireless Setup (简体中文).
- 多功能键。配置详见Extra keyboard keys (简体中文).
- #触摸板。如何配置触摸板（Synaptics或Alps）的灵敏度、加速、键位功能、滚动条？
- #硬盘冲击保护

在你配置笔记本电脑时，这几项内容都是很关键的。幸运的是，Arch Linux提供了所需的软件工具。下文重点讲述这些软件，并附以适当的提示和教程。

注意：下面的链接可能对你有用：

- http://www.linux-on-laptops.com/
- http://www.linlap.com/

## 电源管理

如果想充分利用电池容量，电源管理是非常重要的。下列工具能帮助延长电池寿命，并保持你笔记本电脑的低温和静音。

### Power saving

请阅读 power saving.

### 电池状态监控程序

电池状态当然可以从终端用 acpi 读取。安装Acpi用这条命令

    # pacman -S acpi

有一个简单的能驻留在系统托盘的电池监控程序：batterymon，可以在AUR中找到。

### Thinkpad电池管理

参见这篇文章 tp_smapi.

### Cpufrequtils

CPU frequency scaling依据当前系统载荷及电源方案，使CPU加速或降速。快速简易的安装。

### Pm-utils

Pm-utils 提供系统挂起和电量状态的配置框架，Pm-utils 可以配合 cpufrequtils 以提供完整的电源管理解决方案。

### Lapsus

Lapsus[broken link: invalid section] 是一组程序，它们便于对多种笔记本电脑的功能进行控制。目前它支持华硕笔记本电脑内核模块（由ACPIAsus项目提供）的大部分功能，比如额外的LED屏、快捷键、背光控制等。它也通过IBM ThinkPad ACPI Extras Driver 和 NVRAM设备 支持一些IBM笔记本电脑的特性。

### Install PowerTOP

PowerTOP is a handy utility from Intel that displays which hardware/processes are using the most power on your system, and provides instructions on how to stop or remove power-wasting services. Works great for mobile Intel CPUs; provides the current CPU state and suggestions for power saving. Also works on AMD systems, but does not provide as much information about the CPU state. Install with:

    # pacman -S powertop

### Laptop mode tools

Install Laptop Mode Tools with:

    # pacman -S laptop-mode-tools

- The configuration files can be found in /etc/laptop-mode/laptop-mode.conf and /etc/laptop-mode/conf.d/*
- Be sure to add laptop-mode to the DAEMONS array in /etc/rc.conf
- Be sure to go through the config files, as many powersaving features are not enabled by default.

See this thread for more information.

### PCIe ASPM

On some laptops, powertop suggests enabling the CONFIG_PCIEASPM kernel option. It can be found unter "Bus options (PCI etc.)"->"PCI Express ASPM support". This option is marked as experimental in the current kernel (2.6.35) and allows the PCIe links to enter a power saving state.

According to [1], this option might degrade performance a bit, but on an Acer 3820TG laptop, it can reduce power consumption by about one third or even more.

More experience with this setting would be appreciated, so please share them here!

It seems like the option is going to be enabled by default in kernel 2.6.36; if so, the information here will be obsolete soon.

### Suggestions for saving power

Note: Not only are these not needed if using laptop-mode-tools, but using laptopmode also gives you the benefit of applying them only when desired (ie, while the AC cable is unplugged).

#### Disk-related tweaks

Disable file access time: every time you access (read) a file the filesystem writes an access time to the file metadata. You can disable this on individual files by using the chattr command, or you can enable it on an entire disk by setting the noatime option in your fstab, as follows:

    /dev/sda1          /          ext3          defaults,noatime          1  2

Source

  Note: disabling atime causes troubles with mutt and other applications that make use of file timestamps. Consider compromising between performance and compatibility by using mount option relatime instead, or look into mutt work-around for noatime.

To allow the CD/DVD rom to spin down after a while, run the following:

    /usr/bin/hal-disable-polling --device /dev/scd0

#### 硬盘停转问题

Documented here

To prevent your laptop hard drive from spinning down too often (result of too aggressive APM defaults) do the following:

Add the following to /etc/rc.local

    hdparm -B 254 /dev/sdX where X is your hard drive device

You can also set it to 255 to completely disable spinning down. You may wish to set a lower value if you move your laptop around as lower values park the heads more often and reduce the chance of damage to your hard disk while it is being moved. If you don't move your laptop at all when you are using it, then 255 or 254 is probably best. If you do, then you might want to try a lower value. A value like 128 might be a good middle-ground.

Add the following to /etc/pm/sleep.d/50-hdparm_pm

    #!/bin/sh

    if [ -n "$1" ] && ([ "$1" = "resume" ] || [ "$1" = "thaw" ]); then
    	hdparm -B 254 /dev/your-hard-drive > /dev/null
    fi

and run "chmod +x /etc/pm/sleep.d/50-hdparm_pm" to make sure it resets after suspend. Again, you can change the value 254 as you see fit.

Now the APM level should be set for your hard drive.

For some laptops, the option -S to hdparm can also be relevant (sets the spindown time for the drive). Note that all these options can also be configured using the laptop-mode tools. This will allow you to set a high value when on AC and a lower value when you are running on battery power.

## 触摸板

To get your touchpad working properly, see the Touchpad Synaptics page. Note that your laptop may have an ALPS touchpad (such as the DELL Inspiron 6000), and not a Synaptics touchpad. In either case, see the link above.

## Special Buttons

To configure any special keys or buttons on your laptop, please refer to the Extra keyboard keys page.

## 硬盘冲击保护

There are several laptops from different vendors featuring shock protection capabilities. As manufacturers have refused to support open source development of the required software components so far, Linux support for shock protection varies considerably between different hardware implementations.

Currently, only one project, named HDAPS, support this kind of protection, which is prepared for IBM/Lenovo Thinkpads.

Just Check Hard Disk Active Protection System.

Categories:

- 简体中文
- Laptops (简体中文)

Hidden category:

- Pages with broken section links