Commenti disabilitati
gksudo gedit /etc/pm/sleep.d/20_custom-ehci_hcd
#!/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
sudo chmod +x /etc/pm/sleep.d/20_custom-ehci_hcd
sudo rm /etc/pm/sleep.d/20_custom-ehci_hcd

Fonte

Fonte

Comments are closed.