pm-utils-1.4.1

Power Management Utilities の概要

The Power Management Utilities provide simple shell command line tools to suspend and hibernate the computer. They can be used to run user supplied scripts on suspend and resume.

[注記]

注記

On a system using systemd as the init system, systemd already provides this functionality. As a result, this package is probably not needed, and it may conflict with systemd. Read the documentation for suspend.target and hibernate.target in the man page systemd.special(7) for more details.

[注記]

注記

LFS や依存パッケージが本ブックに示す最新安定バージョンでなかった場合には、BLFS 開発版においては、パッケージのビルドや処理実行が適切に行われないことがあります。

パッケージ情報

Additional Downloads

Power Management Utilities の依存パッケージ

任意

xmlto-0.0.28 (man ページ生成のため)

任意 (実行時)

Hdparm-9.65, Wireless Tools-29, ethtool, vbetool

カーネルの設定

必要に応じて、以下に示すカーネル設定オプションを有効にし、カーネルを再コンパイルします。

Power management and ACPI options --->
  [*] Suspend to RAM and standby                                       [SUSPEND]
  [*] Hibernation (aka 'suspend to disk')                          [HIBERNATION]

Suspend to RAM allows the system to enter sleep states in which main memory is powered and thus its contents are preserved. The method cuts power to most parts of the machine aside from the RAM. Because of the large power savings, it is advisable for laptops to automatically enter this mode when the computer is running on batteries and the lid is closed (or the user is inactive for some time).

Suspend to disk (Hibernation) saves the machine's state into swap space and completely powers off the machine. When the machine is powered on, the state is restored. Until then, there is zero power consumption. Suspend to RAM and hibernation are normally appropriate for portable devices such as laptops, but can be used on workstations. The capability is not really appropriate for servers.

To use hibernation, the kernel parameter resume=/dev/<swap_partition> has to be used on the kernel command line (in grub.cfg). The swap partition should be at least the size of the physical RAM on the system.

Power Management Utilities のインストール

First, fix several bugs and a couple of incompatibilities with newer kernels:

patch -Np1 -i ../pm-utils-1.4.1-bugfixes-1.patch

以下のコマンドを実行して Power Management Utilities をビルドします。

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --docdir=/usr/share/doc/pm-utils-1.4.1 &&
make

このパッケージにテストスイートはありません。

root ユーザーになって以下を実行します。

make install

xmlto-0.0.28 をインストールしていない場合は root ユーザーになって、生成済の man ページをコピーします。

install -v -m644 man/*.1 /usr/share/man/man1 &&
install -v -m644 man/*.8 /usr/share/man/man8 &&
ln -sv pm-action.8 /usr/share/man/man8/pm-suspend.8 &&
ln -sv pm-action.8 /usr/share/man/man8/pm-hibernate.8 &&
ln -sv pm-action.8 /usr/share/man/man8/pm-suspend-hybrid.8

Power Management Utilities の設定

Suspend or resume functionality can be easily modified by installing files into the /etc/pm/sleep.d directory. These files, known as hooks, are run when the system is put into a sleep state or resumed. Default hooks are located in /usr/lib/pm-utils/sleep.d, and user hooks should be put in /etc/pm/sleep.d. See the pm-action(8) man page for more information.

In order to use hibernation with GRUB and a swap partition, you need to add kernel parameter resume=swap_partition (e.g. resume=/dev/sda1) to the kernel line in the /boot/grub/grub.cfg configuration file.

パッケージ構成

インストールプログラム: on_ac_power, pm-hibernate, pm-is-supported, pm-powersave, pm-suspend, pm-suspend-hybrid
インストールライブラリ: なし
インストールディレクトリ: /etc/pm, /usr/lib/pm-utils, /usr/share/doc/pm-utils-1.4.1

概略説明

on_ac_power

is a script that determines whether the system is running on AC power (rather than a battery)

pm-hibernate

is a symlink to pm-action script that puts the computer into hibernate mode (the system is fully powered off and system state is saved to disk)

pm-is-supported

is a script that checks whether power management features such as suspend and hibernate are supported

pm-powersave

is a script that puts the computer into powersaving (low power) mode

pm-suspend

is a symlink to pm-action script that puts the computer into suspend mode (most devices are shut down and system state is saved in RAM)

pm-suspend-hybrid

is a symlink to pm-action script that puts the computer into hybrid-suspend mode (the system does everything it needs to hibernate, but suspends instead of shutting down)