在Gentoo上安装suspend2还是很简单的:
1,安装suspend2-sources
suspend2-sources是打了suspend2补丁的gentoo-sources。安装时会把其它需要的东西都依赖装上的。
emerge suspend2-sources
2,编译内核
先把原来的.config拷到新目录树下,然后make oldconfig,选上[*] Power Management support 下的<*> Suspend2 ,以及suspend2下的
│ │ --- Suspend2 │ │
│ │ --- Image Storage (you need at least one allocator) │ │
│ │ <*> File Allocator │ │
│ │ <*> Swap Allocator │ │
│ │ --- General Options │ │
│ │ <*> Compression support │ │
│ │ <*> Userspace User Interface support │ │
│ │ () Default resume device name │ │
│ │ [*] Allow Keep Image Mode │ │
│ │ [*] Replace swsusp by default │ │
│ │ [*] Checksum pageset2
还有
--- Cryptographic API
后者加上了,才能在休眠复制镜象时使用压缩算法。
3,准备swap分区
如果已经有了,要确定你的swap分区够大----至少要跟你的内存一样大。
通过fdisk 创建swap分区->mkswap->swapon,还要修改/etc/fstab让开机时自动加载swap分区。
4,测试
# hibernate
先在文本界面下测试,通过后在进入X测试,如果两者皆通过则说明suspend2已安装成功并能使用。