新手學堂:Linux操作系統下的休眠與待機
更新時間: 2008-02-04 19:50:05來源: 粵嵌教育瀏覽量:669
內核2.6.23以前要用suspend2-source,以后就用tuxonice-source了。
1、安裝tuxonice-source和hibernate-script
前者是打了休眠和待機功能的補丁的內核源碼包,后者是提供了用戶執行休眠和待機的腳本。
2、編譯內核
下面是我的配置
* Power Management support │ │
│ │ [ ] Legacy Power Management API (DEPRECATED) │ │
│ │ [ ] Power Management Debug Support │ │
│ │ *] Suspend to RAM and standby │ │
│ │ *] Hibernation (aka 'suspend to disk') │ │
│ │ () Default resume partition │ │
│ │ <*> Enhanced Hibernation (TuxOnIce) --->
--- Enhanced Hibernation TuxOnIce) │ │
│ │ --- Image Storage (you need at least one allocator) │ │
│ │ <*> File Allocator │ │
│ │ <*> Swap Allocator │ │
│ │ --- General Options │ │
│ │ <*> Compression support │ │
│ │ <*> Userspace User Interface support │ │
│ │ (/usr/local/sbin/tuxonice_fbsplash) Default userui program location │ │
│ │ [ ] Allow Keep Image Mode │ │
│ │ *] Replace swsusp by default │ │
│ │ < > Cluster support ---> │ │
│ │ *] Checksum pageset2 │ │
│ │ (25) Default waiting time for emergency boot messages │ │
|
3、使用新內核
在終端下和X里面用
hibernate -n和hibernate-ram -n分別試試,如果一切正常則表明配置是沒問題的,可以正常使用(去掉后面的-n)
4、hibernate-ram不能resume的問題——vbetool
剛開始在我的dell 1400本本上待機后再恢復,屏幕會變得很暗很暗,終端下根本看不見東西,但是機器是在運行的。搜了下,發現需要用vbetool,安裝vbetool,然后打開/etc/hibernate/common.conf里的
### vbetool
EnableVbetool yes
|
再試試,就一切正常了。
筆記本有了待機和休眠的功能,方能體現其價值啊!