特殊:Badtitle/NS100:SuspendHowto:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
第29行: 第29行:
</nowiki></pre>
</nowiki></pre>
and uncomment the second line by deleting the # character, to read:
and uncomment the second line by deleting the # character, to read:
<pre><nowiki>ACPI_SLEEP=true
<pre><nowiki>
ACPI_SLEEP=true
</nowiki></pre>
</nowiki></pre>
==== Ubuntu 6.06 ====
==== Ubuntu 6.06 ====
第35行: 第36行:
If you have an nVidia card, visit the [[UbuntuHelp:NvidiaLaptopBinaryDriverSuspend|NvidiaLaptopBinaryDriverSuspend]] wiki page.
If you have an nVidia card, visit the [[UbuntuHelp:NvidiaLaptopBinaryDriverSuspend|NvidiaLaptopBinaryDriverSuspend]] wiki page.
For those running the fglrx driver, you need uncomment the line in /etc/default/fglrx, so it reads as
For those running the fglrx driver, you need uncomment the line in /etc/default/fglrx, so it reads as
<pre><nowiki>FGLRX_ACPI_SWITCH_POWERSTATES=true
<pre><nowiki>
FGLRX_ACPI_SWITCH_POWERSTATES=true
</nowiki></pre>
</nowiki></pre>
The ipw2200 driver currently doesn't allow suspend. The easy workaround is to edit /etc/default/acpi-support, and add ipw2200 to the MODULES list, like so:
The ipw2200 driver currently doesn't allow suspend. The easy workaround is to edit /etc/default/acpi-support, and add ipw2200 to the MODULES list, like so:
<pre><nowiki>MODULES="ipw2200"
<pre><nowiki>
MODULES="ipw2200"
</nowiki></pre>
</nowiki></pre>
=== Event Processing ===
=== Event Processing ===
第58行: 第61行:


This should help to understand ''"What happens, when XX button is pressed?"''. In case something in the path is not working, this should help to adopt the scripts, add debugging and fix the problems.
This should help to understand ''"What happens, when XX button is pressed?"''. In case something in the path is not working, this should help to adopt the scripts, add debugging and fix the problems.
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
[[category:CategoryCleanup]]


[[category:UbuntuHelp]]
[[category:UbuntuHelp]]

2009年5月12日 (二) 18:58的版本

{{#ifexist: :SuspendHowto/zh | | {{#ifexist: SuspendHowto/zh | | {{#ifeq: {{#titleparts:SuspendHowto|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:SuspendHowto|1|-1|}} | zh | | }}

This page describes suspending in Ubundtu 4.10 ("Warty Warthog") NOTE: For succesful suspend to disk (hibernation), you need swap partition (or file, though I have not tested with swap file) bigger than is actual size of your memory. All your memory and also everything that was swaped at the time of hibernation must fit in swap, so at the size of swap should be 1.5x-2x bigger than size of your RAM.

Introduction

Suspend mode is a special low-power mode, often used on laptops, that preserves the contents of RAM while conserving power. There are two different standards for power management (which handles suspend in Linux), ACPI and APM. ACPI has more advanced features, but is only found on computers made in the last few years. APM is older, and somewhat more mature, but doesn't offer as many features as ACPI. It also isn't available on many new PCs. Also, there are two main forms of suspend - suspend-to-RAM and suspend-to-disk (also known as "software suspend" or "hibernation"). Suspend-to-RAM uses more power, but is almost instant. Suspend-to-disk, on the other hand, uses no power (the system actually powers off), but takes longer to suspend/resume. This HOWTO will discuss all of these methods. WARNING: This is not officially supported in Ubuntu Warty, and may cause system problems or data loss. Use with caution.

Suspending to RAM (APM)

To enable APM on a system:

  • edit your /etc/modules file and add apm to the list of modules.
  • edit the defoptions line of your /boot/grub/menu.lst file so that it ends with acpi=off, and then sudo update-grub to update the GRUB configuration.
  • Add the modules shpchp and pciehp to the end of the /etc/modprobe.d/blacklist file (they don't work w/APM).
  • Finally, reboot the computer. If your system supports APM, everything should be set up.

Close the laptop lid (if you have a laptop) or press the Sleep button to suspend to RAM. Some systems may not work properly with this, and many new systems don't support APM at all. In this case, search for information on suspending your particular laptop in the wiki or elsewhere. Also, if APM doesn't work, try ACPI. Note that APM doesn't support all the power management features of many newer laptops, and also doesn't work with suspend-to-disk using the code in the kernel.

ACPI

To suspend to disk, choose "Hibernate" from the GNOME logout menu. To suspend to RAM, edit

/etc/default/acpi-support

and uncomment the second line by deleting the # character, to read:

ACPI_SLEEP=true

Ubuntu 6.06

Dapper needs another step to enable suspend. Execute gconf-editor, and visit apps/gnome-powermanager and enable "can_suspend". You can enable/disable suspend and/or hibernation from there. If you have an nVidia card, visit the NvidiaLaptopBinaryDriverSuspend wiki page. For those running the fglrx driver, you need uncomment the line in /etc/default/fglrx, so it reads as

FGLRX_ACPI_SWITCH_POWERSTATES=true

The ipw2200 driver currently doesn't allow suspend. The easy workaround is to edit /etc/default/acpi-support, and add ipw2200 to the MODULES list, like so:

MODULES="ipw2200"

Event Processing

For a working suspend and hibernate support several pieces of software have to work together, which results in a highly integrated system that needs to be understood in case troubleshooting is necessary. The following description should help to explain the processing of events as of Ubuntu 6.06 LTS (Dapper).

  1. Press keyboard button (sleep, power)
  2. generation of events
    1. acpid
      1. /etc/acpi/events/{sleepbtn,powerbtn}
      2. /etc/acpi/sleep.sh or /etc/acpi/hibernate.sh
        1. /etc/acpi/prepare.sh: includes /etc/acpi/suspend.d/*.sh
        2. triggers suspend in kernel by echo $SLEEP_MODE > /sys/power/state
        3. /etc/acpi/resume.sh: includes /etc/acpi/resume.d/*.sh
    2. hal event
      1. gnome-power-manager or klaptopd kicks in and looks up its policy
      2. /usr/share/hal/scripts/hal-system-power-{suspend,hibernate}
        1. checks for avaiable handlerss: powersave, pmi, pm-hibernate, hibernate, direct /sys/power/state
        2. /usr/sbin/pmi action {suspend,hibernate} force
          1. /etc/acpi/sleep.sh or /etc/acpi/hibernate.sh # following processing as described for the acpid case

          This should help to understand "What happens, when XX button is pressed?". In case something in the path is not working, this should help to adopt the scripts, add debugging and fix the problems.