Software Suspend 2 on Debian (original) (raw)

西元2005年02月06日 - Kan-Ru Chen

我這台 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 <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi><mi>N</mi><mi>I</mi><mi>T</mi><mi>R</mi><mi>D</mi><mi>D</mi><mi>I</mi><mi>R</mi><mi mathvariant="normal">/</mi><mi>l</mi><mi>i</mi><mi>n</mi><mi>u</mi><mi>x</mi><mi>r</mi><mi>c</mi></mrow><annotation encoding="application/x-tex">INITRDDIR/linuxrc </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal" style="margin-right:0.00773em;">TR</span><span class="mord mathnormal" style="margin-right:0.02778em;">DD</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="mord">/</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord mathnormal">in</span><span class="mord mathnormal">ux</span><span class="mord mathnormal">rc</span></span></span></span>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 裡面的