Logo de ce site

Accueil > GnuLinux Debian/Ubuntu > Mise en veille difficile sur Asus A72J Anita

Mise en veille difficile sur Asus A72J Anita

samedi 21 mai 2011

La solution a ce problème a été trouvée ici :

En voila une copie :

Step 1

Create a script under /etc/pm/sleep.d/. It can be any name, but to ensure the load order, use the prefix 20_.

sudo gedit /etc/pm/sleep.d/20_custom-ehci_hcd

Le script step 2 semble plus stable que l’ancien script (renonmé en step 2 old)

Step 2

Step 2 old

Insert the following code into the file you have just created :

#!/bin/sh

TMPLIST_E=/tmp/ehci-dev-list
TMPLIST_X=/tmp/xhci-dev-list
E_DIR=/sys/bus/pci/drivers/ehci_hcd
X_DIR=/sys/bus/pci/drivers/xhci_hcd
E_BIND=$E_DIR""/bind
E_UNBIND=$E_DIR""/unbind
X_BIND=$X_DIR""/bind
X_UNBIND=$X_DIR""/unbind


#param1 = temp file, param2 = device dir, param3 = unbind
unbindDev (){
#inspired by http://art.ubuntuforums.org/showpost.php?p=9744970&postcount=19    
 echo -n '' > $1
   for i in `ls $2 | egrep '[0-9a-z]+\:[0-9a-z]+\:.*$'`; do
     echo -n "$i" | tee $3
     echo "$i" >> $1
 done
}

#param1 = tem file, param2 = bind
bindDev(){
 [ -f $1 ] || return
 
 for i in `cat $1`; do
   echo -n "$i" | tee $2

 done
 rm $1
}


case "${1}" in
 hibernate|suspend)
   unbindDev $TMPLIST_E $E_DIR $E_UNBIND
   unbindDev $TMPLIST_X $X_DIR $X_UNBIND
       ;;
 resume|thaw)
   bindDev $TMPLIST_E $E_BIND
   bindDev $TMPLIST_X $X_BIND
       ;;
esac

Step 3

Add executable permission :

sudo chmod 755 /etc/pm/sleep.d/20_custom-ehci_hcd

Result

Your suspend/hibernate should be now working as expected. Suggestions on improving this script are welcome.