Software Suspend 2 on Debian

我這台 NB 是 ASUS M2400Ne 系列,絕大多數晶片都是用 Intel 製造的,用
Linux 很容易就可以驅動起來,用了一段時間都很滿意

只是我不知道該怎麼設定他的休眠功能,每次只要一起動 S3(sleep) 就會一直睡下去,沒辦法叫醒 >_<

安裝完 swsusp2 的 patch 與 hibernate 以後
要在 /etc/mkinitrd/scripts 下加入這個 script

#!/bin/sh
# Put this script in /etc/mkinitrd/scripts/ and regenerate your initrd (by
# "mkinitrd -o /boot/initrd.img-`uname -r`" or reinstall your kernel package.

# Figure out swap device from the first device listed in /proc/swaps
swap_device=`awk 'BEGIN{getline;getline;print$1}'  /proc/software_suspend/resume2`

# Modify linuxrc script
mv $INITRDDIR/linuxrc $INITRDDIR/linuxrc.real
cat  $INITRDDIR/linuxrc
#!/bin/sh

export PATH=/sbin:/bin

mount -t proc proc /proc
. /loadmodules
$resume2
echo >> /proc/software_suspend/do_resume
umount /proc
. ./linuxrc.real
EOT

chmod 777 $INITRDDIR/linuxrc

注意:這個 script 跟網頁上得不一樣,因為我是把 swsusp2 built 進 kernel 裡面的