LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enabling Suspend on Linux Lite
#1
1) Open a terminal and type in:
Code:
sudo leafpad /etc/pm/sleep.d/20_custom-ehci_hcd

2) Paste the following code into the file, save then close it.
Code:
#!/bin/sh
#inspired by http://art.ubuntuforums.org/showpost.php?p=9744970&postcount=19
#...and http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-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
  done
}

bindDev() {
  if [ -s $DEV_LIST ]; then
    while read driver dev; do
      DDIR=$DRIVERS_DIR/${driver}_hcd
      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
}

case "$1" in
  hibernate|suspend) unbindDev;;
  resume|thaw)       bindDev;;
esac

3) Make the file executable, in the same terminal type in:

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

Source: http://thecodecentral.com/2011/01/18/fix...orking-bug

Working on 1.0.6, need confirmation this will work on 1.0.8 please.
Reply


Messages In This Thread
Enabling Suspend on Linux Lite - by Valtam - 04-28-2014, 08:41 AM
Re: Enabling Suspend on Linux Lite - by ohjrson - 05-22-2014, 04:50 AM
Re: Enabling Suspend on Linux Lite - by philip chan yee ling - 08-29-2014, 12:06 PM
Re: Enabling Suspend on Linux Lite - by Valtam - 08-30-2014, 08:30 AM
Re: Enabling Suspend on Linux Lite - by philip chan yee ling - 09-02-2014, 10:04 AM
Re: Enabling Suspend on Linux Lite - by Valtam - 09-02-2014, 06:39 PM
Re: Enabling Suspend on Linux Lite - by philip chan yee ling - 09-05-2014, 10:59 AM
Re: Enabling Suspend on Linux Lite - by philip chan yee ling - 09-07-2014, 04:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)