【转】部分电脑安装升级 ubuntu 12.04 后无法挂起问题的解决(挂起无法唤醒同样有效)

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

我的Ubuntu12.04是安装的windows桌面安装版(使用wubi安装),原来使用状况良好,前两天安装了更新后,发现系统挂起后不能唤醒--出现的状况有:屏幕暗黑但是能移动鼠标,打不开原桌面即使有时能打开桌面但是什么功能按键也没有,需要进入终端(Ctrl+Alt+F1)重启系统! 

google了很久终于找到解决方法,根据http://ubuntuforums.org/showthread.php?p=11926504方法解决了。
方法:
一、打开终端在/etc/pm/sleep.d/建立20_custom-ehci_hcd文件
sudo gedit /etc/pm/sleep.d/20_custom-ehci_hcd
二、复制下面代码到文件里保存并退出
 
#!/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

 

三、改变20_custom-ehci_hcd文件权限
sudo chmod 755 /etc/pm/sleep.d/20_custom-ehci_hcd
四、重启
我电脑就是这样弄好的。

 

posted @ 2013-12-15 13:05  沐阳  阅读(720)  评论(0编辑  收藏  举报