【轉】部分電腦安裝升級 ubuntu 12.04 後沒法掛起問題的解決(掛起沒法喚醒一樣有效)

原文地址:http://blog.csdn.net/longerzone/article/details/7860232php

個人Ubuntu12.04是安裝的windows桌面安裝版(使用wubi安裝),原來使用情況良好,前兩天安裝了更新後,發現系統掛起後不能喚醒--出現的情況有:屏幕暗黑可是能移動鼠標,打不開原桌面即便有時能打開桌面可是什麼功能按鍵也沒有,須要進入終端(Ctrl+Alt+F1)重啓系統! git

google了好久終於找到解決方法,根據http://ubuntuforums.org/showthread.php?p=11926504方法解決了。
方法:
1、打開終端在/etc/pm/sleep.d/創建20_custom-ehci_hcd文件
sudo gedit /etc/pm/sleep.d/20_custom-ehci_hcd
2、複製下面代碼到文件裏保存並退出
 
#!/bin/sh
#inspired by http://art.ubuntuforums.org/showpost...0&postcount=19
#...and http://thecodecentral.com/2011/01/18...ot-working-bug
# tidied by tqzzaa 
VERSION=1.1
DEV_LIST=/tmp/usb-dev-list
DRIVERS_DIR=/sys/bus/pci/drivers
DRIVERS="ehci xhci" # ehci_hcd, xhci_hcd
HEX="[[:xdigit:]]"
MAX_BIND_ATTEMPTS=2
BIND_WAIT=0.1
unbindDev() {
echo -n > $DEV_LIST 2>/dev/null
for driver in $DRIVERS; do
DDIR=$DRIVERS_DIR/${driver}_hcd
for dev in `ls $DDIR 2>/dev/null | egrep "^$HEX+:$HEX+:$HEX"`; do
echo -n "$dev" > $DDIR/unbind
echo "$driver $dev" >> $DEV_LIST
done
#for bus in $EHCI_BUSES; do
echo -n $bus > /sys/bus/pci/drivers/ehci_hcd/unbind
# done
done
}
bindDev() {
if [ -s $DEV_LIST ]; then
while read driver dev; do
DDIR=$DRIVERS_DIR/${driver}_hcd
#for bus in $EHCI_BUSES; do
echo -n $bus > /sys/bus/pci/drivers/ehci_hcd/bind
#done
while [ $((MAX_BIND_ATTEMPTS)) -gt 0 ]; do
echo -n "$dev" > $DDIR/bind
if [ ! -L "$DDIR/$dev" ]; then
sleep $BIND_WAIT
else
break
fi
MAX_BIND_ATTEMPTS=$((MAX_BIND_ATTEMPTS-1))
done
done < $DEV_LIST
fi
rm $DEV_LIST 2>/dev/null
chvt 1
chvt 7
}
EHCI_BUSES="0000:00:1a.0 0000:00:1d.0"
case "$1" in
hibernate|suspend)
unbindDev;;
resume|thaw)
bindDev;;
esac
3、改變20_custom-ehci_hcd文件權限 sudo chmod 755 /etc/pm/sleep.d/20_custom-ehci_hcd 4、重啓 我電腦就是這樣弄好的。
相關文章
相關標籤/搜索