diff options
author | lcapriotti <lcapriotti@svn> | 2009-11-04 14:59:53 +0000 |
---|---|---|
committer | lcapriotti <lcapriotti@svn> | 2009-11-04 14:59:53 +0000 |
commit | 092685dcd77e518aa3977c5511d3c9397dddb01b (patch) | |
tree | e2f594e95488d9f30acb7ff662298628d45f49a4 /tools | |
parent | 6215621a9b5f5841bef060ee8edd2ed272837c8a (diff) |
enable resume with USB remote
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@24278 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'tools')
-rw-r--r-- | tools/XBMCLive/xbmc-live.conf | 69 |
1 files changed, 61 insertions, 8 deletions
diff --git a/tools/XBMCLive/xbmc-live.conf b/tools/XBMCLive/xbmc-live.conf index 9e85ec5d52..f935ce52d3 100644 --- a/tools/XBMCLive/xbmc-live.conf +++ b/tools/XBMCLive/xbmc-live.conf @@ -104,6 +104,47 @@ script end script post-start script + findUSBPort() { + local FD=7 + local tmpFile=$(mktemp) + local eof=0 + local line + local usbPort="" + local pciDevice="" + local inBlock="0" + local token=$1 + + lshal > $tmpFile + + # Open files. + eval exec "$FD<$tmpFile" + + while [ $eof -eq 0 ] + do + if read line <&$FD; then + if [ -n "$(echo $line | grep -i $token)" ]; then + if [ "$inBlock" = "0" ]; then + inBlock="1" + token="linux.sysfs_path" + else + pciDevice=$(echo $line | awk -F/ '{ print $5}') + eof=1 + fi + fi + else + eof=1 + fi + done + + if [ -n "$pciDevice" ] ; then + usbPort=$(cat /proc/acpi/wakeup | grep $pciDevice | awk '{ print $1}') + fi + + echo $usbPort + } + + + if [ $(grep -i setvolume /tmp/xbmcliveParams) ] ; then /usr/bin/setAlsaVolumes fi @@ -111,18 +152,30 @@ post-start script if [ ! $(grep -i nodiskmount /tmp/xbmcliveParams) ] ; then /usr/bin/diskmounter fi + + if [ $(grep -i wakeOnUSBRemote /tmp/xbmcliveParams) ] ; then + lircDriver=$(dmesg | grep usbcore | grep -i 'lirc' | sed -e "s/.* \(lirc*\)/\1/" | head -n 1) + if [ ! -n "$lircDriver" ] ; then + # No lirc driver loaded + exit + fi + + usbPort=$(findUSBPort "${lircDriver}") + + if [ -z "$usbPort" ]; then + # No USB Remote found + exit + fi + + echo $usbPort > /proc/acpi/wakeup + echo -1 >/sys/module/usbcore/parameters/autosuspend + fi end script pre-stop script touch /tmp/noRestartXBMC rm /tmp/xbmcliveParams - # Needed? - killall xbmc.bin + # Clear VT 8 of any console messages + clear >/dev/tty8 || true end script - -post-stop script - if [ $(cat /proc/cmdline | grep splash) ] ; then - start usplash - fi -end script
\ No newline at end of file |