From 3002a51a4b14b8d43de9fd9638707872009047de Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 17 Jan 2011 15:09:09 +0100 Subject: [PATCH] xbmc: add and use ps3remote_helper and wiiremote_helper scripts to start properly with udev Signed-off-by: Stephan Raue --- packages/mediacenter/xbmc/install | 7 +++- .../xbmc/rules.d/98-ps3remote.rules | 6 +--- .../xbmc/rules.d/98-wiiremote.rules | 6 +--- .../mediacenter/xbmc/scripts/ps3remote_helper | 34 +++++++++++++++++++ .../mediacenter/xbmc/scripts/wiiremote_helper | 34 +++++++++++++++++++ 5 files changed, 76 insertions(+), 11 deletions(-) create mode 100755 packages/mediacenter/xbmc/scripts/ps3remote_helper create mode 100755 packages/mediacenter/xbmc/scripts/wiiremote_helper diff --git a/packages/mediacenter/xbmc/install b/packages/mediacenter/xbmc/install index 5c4950982d..7cfb7bffc3 100755 --- a/packages/mediacenter/xbmc/install +++ b/packages/mediacenter/xbmc/install @@ -25,7 +25,8 @@ PYTHON_LIBDIR="`ls -d $INSTALL/usr/lib/python*`" mkdir -p $INSTALL/usr/bin - cp $PKG_DIR/scripts/* $INSTALL/usr/bin + cp $PKG_DIR/scripts/cputemp $INSTALL/usr/bin + cp $PKG_DIR/scripts/gputemp $INSTALL/usr/bin cp $PKG_BUILD/tools/EventClients/Clients/XBMC\ Send/xbmc-send.py $INSTALL/usr/bin/xbmc-send mkdir -p $INSTALL/usr/lib/xbmc @@ -66,6 +67,8 @@ mkdir -p $PYTHON_LIBDIR/site-packages/xbmc if [ "$WIIMOTE_SUPPORT" = yes ]; then mkdir -p $INSTALL/usr/bin cp $PKG_BUILD/tools/EventClients/Clients/WiiRemote/WiiUse_WiiRemote $INSTALL/usr/bin/xbmc-wiiremote + mkdir -p $INSTALL/lib/udev + cp $PKG_DIR/scripts/wiiremote_helper $INSTALL/lib/udev mkdir -p $INSTALL/lib/udev/rules.d cp $PKG_DIR/rules.d/98-wiiremote.rules $INSTALL/lib/udev/rules.d fi @@ -77,6 +80,8 @@ if [ "$PS3REMOTE_SUPPORT" = yes ]; then cp $PKG_BUILD/tools/EventClients/icons/bluetooth.png $INSTALL/usr/share/pixmaps/xbmc mkdir -p $PYTHON_LIBDIR/site-packages/xbmc echo 'ICON_PATH="/usr/share/pixmaps/xbmc/"' > $PYTHON_LIBDIR/site-packages/xbmc/defs.py + mkdir -p $INSTALL/lib/udev + cp $PKG_DIR/scripts/ps3remote_helper $INSTALL/lib/udev mkdir -p $INSTALL/lib/udev/rules.d cp $PKG_DIR/rules.d/98-ps3remote.rules $INSTALL/lib/udev/rules.d fi diff --git a/packages/mediacenter/xbmc/rules.d/98-ps3remote.rules b/packages/mediacenter/xbmc/rules.d/98-ps3remote.rules index 2cd4369835..913d47f406 100644 --- a/packages/mediacenter/xbmc/rules.d/98-ps3remote.rules +++ b/packages/mediacenter/xbmc/rules.d/98-ps3remote.rules @@ -22,10 +22,6 @@ SUBSYSTEM!="bluetooth", GOTO="end" # Start PS3 Remote support if bluetooth is starting -ACTION=="add", RUN+="/usr/bin/xbmc-ps3remote localhost 9777" -ACTION=="change", RUN+="/usr/bin/xbmc-ps3remote localhost 9777" - -# remove PS3 Remote support if bluetooth is stopping -ACTION=="remove", RUN+="killall xbmc-ps3remote" +ACTION=="add|remove", RUN+="/lib/udev/ps3remote_helper" LABEL="end" diff --git a/packages/mediacenter/xbmc/rules.d/98-wiiremote.rules b/packages/mediacenter/xbmc/rules.d/98-wiiremote.rules index 2f03365cfc..b12c683a39 100644 --- a/packages/mediacenter/xbmc/rules.d/98-wiiremote.rules +++ b/packages/mediacenter/xbmc/rules.d/98-wiiremote.rules @@ -22,10 +22,6 @@ SUBSYSTEM!="bluetooth", GOTO="end" # Start Wii Remote support if bluetooth is starting -ACTION=="add", RUN+="/usr/bin/xbmc-wiiremote" -ACTION=="change", RUN+="/usr/bin/xbmc-wiiremote" - -# remove Wii Remote support if bluetooth is stopping -ACTION=="remove", RUN+="killall xbmc-wiiremote" +ACTION=="add|remove", RUN+="/lib/udev/wiiremote_helper" LABEL="end" diff --git a/packages/mediacenter/xbmc/scripts/ps3remote_helper b/packages/mediacenter/xbmc/scripts/ps3remote_helper new file mode 100755 index 0000000000..84d8db2806 --- /dev/null +++ b/packages/mediacenter/xbmc/scripts/ps3remote_helper @@ -0,0 +1,34 @@ +#!/bin/sh + +################################################################################ +# Copyright (C) 2009-2010 OpenELEC.tv +# http://www.openelec.tv +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +case "${ACTION}" in + add) + if [ -f /usr/bin/xbmc-ps3remote ]; then + /usr/bin/xbmc-ps3remote localhost 9777 & + fi + ;; + remove) + killall xbmc-ps3remote + ;; +esac + +exit 0 diff --git a/packages/mediacenter/xbmc/scripts/wiiremote_helper b/packages/mediacenter/xbmc/scripts/wiiremote_helper new file mode 100755 index 0000000000..5f8d87556f --- /dev/null +++ b/packages/mediacenter/xbmc/scripts/wiiremote_helper @@ -0,0 +1,34 @@ +#!/bin/sh + +################################################################################ +# Copyright (C) 2009-2010 OpenELEC.tv +# http://www.openelec.tv +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +case "${ACTION}" in + add) + if [ -f /usr/bin/xbmc-wiiremote ]; then + /usr/bin/xbmc-wiiremote & + fi + ;; + remove) + killall xbmc-wiiremote + ;; +esac + +exit 0