From 04fd6f66f561a5adfd953caf257a641b5ad73118 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 5 Nov 2011 16:34:19 +0100 Subject: [PATCH] addon: userspace driver for Sundtek MediaTV Pro (DVB-C, DVB-T, AnalogTV, Composite, S-Video, FM-Radio USB Stick) --- packages/3rdparty/driver/sundtek/meta | 36 +++++++++ packages/3rdparty/driver/sundtek/unpack | 68 ++++++++++++++++ packages/addons/driver/sundtek-mediatv/addon | 34 ++++++++ .../driver/sundtek-mediatv/changelog.txt | 2 + .../config/device_attach_detach.sh | 71 +++++++++++++++++ .../sundtek-mediatv/config/sundtek.conf | 17 ++++ .../sundtek-mediatv/config/sundtek.conf.full | 75 ++++++++++++++++++ .../driver/sundtek-mediatv/icon/icon.png | Bin 0 -> 2806 bytes packages/addons/driver/sundtek-mediatv/meta | 36 +++++++++ .../source/bin/sundtek-mediatv.service | 48 +++++++++++ .../driver/sundtek-mediatv/source/default.py | 23 ++++++ .../source/sleep.d/sundtek-mediatv.power | 48 +++++++++++ 12 files changed, 458 insertions(+) create mode 100755 packages/3rdparty/driver/sundtek/meta create mode 100755 packages/3rdparty/driver/sundtek/unpack create mode 100755 packages/addons/driver/sundtek-mediatv/addon create mode 100755 packages/addons/driver/sundtek-mediatv/changelog.txt create mode 100755 packages/addons/driver/sundtek-mediatv/config/device_attach_detach.sh create mode 100755 packages/addons/driver/sundtek-mediatv/config/sundtek.conf create mode 100755 packages/addons/driver/sundtek-mediatv/config/sundtek.conf.full create mode 100755 packages/addons/driver/sundtek-mediatv/icon/icon.png create mode 100755 packages/addons/driver/sundtek-mediatv/meta create mode 100755 packages/addons/driver/sundtek-mediatv/source/bin/sundtek-mediatv.service create mode 100755 packages/addons/driver/sundtek-mediatv/source/default.py create mode 100755 packages/addons/driver/sundtek-mediatv/source/sleep.d/sundtek-mediatv.power diff --git a/packages/3rdparty/driver/sundtek/meta b/packages/3rdparty/driver/sundtek/meta new file mode 100755 index 0000000000..a3927ac6d7 --- /dev/null +++ b/packages/3rdparty/driver/sundtek/meta @@ -0,0 +1,36 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@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 +################################################################################ + +PKG_NAME="sundtek" +PKG_VERSION="installer_111001.1658" +#PKG_VERSION="installer_development" +PKG_REV="0" +PKG_ARCH="any" +PKG_LICENSE="nonfree" +PKG_SITE="http://support.sundtek.com/" +PKG_URL="http://www.sundtek.de/media/${PKG_NAME}_${PKG_VERSION}.sh" +PKG_DEPENDS="" +PKG_BUILD_DEPENDS="toolchain" +PKG_PRIORITY="optional" +PKG_SECTION="driver/dvb" +PKG_SHORTDESC="Sundtek USB Stick DVB userspace driver" +PKG_LONGDESC="Driver for Sundtek MediaTV Pro (DVB-C, DVB-T, AnalogTV, Composite, S-Video, FM-Radio USB Stick) and Sundtek SkyTV Ultimate (DVB-S/S2 USB)." +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" diff --git a/packages/3rdparty/driver/sundtek/unpack b/packages/3rdparty/driver/sundtek/unpack new file mode 100755 index 0000000000..a77d52bc39 --- /dev/null +++ b/packages/3rdparty/driver/sundtek/unpack @@ -0,0 +1,68 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@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 +################################################################################ + +. config/options $1 + +( + mkdir -p $BUILD/${PKG_NAME}_${PKG_VERSION} + cd $BUILD/${PKG_NAME}_${PKG_VERSION} + sh $SOURCES/$1/${PKG_NAME}_${PKG_VERSION}.sh -e >/dev/null 2>&1 + + rm chk* installer.tar.gz + rm -r 32bit23 arm* dreambox mips* openwrtmipsr2 ppc* +) + +[ "$TARGET_ARCH" = "i386" ] && ARCH_DIR=32bit +[ "$TARGET_ARCH" = "x86_64" ] && ARCH_DIR=64bit +SUNDTEK_ROOT=$BUILD/${PKG_NAME}_${PKG_VERSION}/rootsys + +mkdir -p $SUNDTEK_ROOT +tar xzf $BUILD/${PKG_NAME}_${PKG_VERSION}/$ARCH_DIR/installer.tar.gz -C $SUNDTEK_ROOT + +# fix permissions (on mediasrv binary) +chmod 755 $SUNDTEK_ROOT/opt/bin/* + +# binary search & replace (strings must be same length!) +# mediasrv +# /etc/sunI»dtek.conf +# /etc/sundtek.conf +# libdrv_em28xx.so +# /etc/sundtek.conf +# mediaclient +# /etc/sundtek_diseqc.conf + +#perl -pi -e 's|\x2F\x65\x74\x63\x2F\x73\x75\x6E\x49\xBB\x64\x74\x65\x6B\x2E\x63\x6F\x6E\x66|\x2F\x74\x6D\x70\x2F\x73\x75\x6E\x49\xBB\x64\x74\x65\x6B\x2E\x63\x6F\x6E\x66|g' $SUNDTEK_ROOT/opt/bin/mediasrv +#perl -pi -e 's|/etc/sundtek.conf|/tmp/sundtek.conf|g' $SUNDTEK_ROOT/opt/bin/mediasrv +#perl -pi -e 's|/etc/sundtek.conf|/tmp/sundtek.conf|g' $SUNDTEK_ROOT/opt/bin/dvb/libdrv_em28xx.so +#perl -pi -e 's|/etc/sundtek_diseqc.conf|/tmp/sundtek_diseqc.conf|g' $SUNDTEK_ROOT/opt/bin/mediaclient + +perl -pi -e 's|/etc/|/tmp/|g' $SUNDTEK_ROOT/opt/bin/mediasrv +perl -pi -e 's|/etc/|/tmp/|g' $SUNDTEK_ROOT/opt/bin/dvb/libdrv_em28xx.so +perl -pi -e 's|/etc/|/tmp/|g' $SUNDTEK_ROOT/opt/bin/mediaclient + +if [ "$PKG_VERSION" = "installer_development" ]; then + wget -q -t 3 -T 3 -O $SUNDTEK_ROOT/sundtek_version.html http://support.sundtek.com/index.php/topic,708.0.html +else + cat >$SUNDTEK_ROOT/sundtek_version.html << MYDATA +${PKG_NAME}_${PKG_VERSION}.sh +MYDATA +fi diff --git a/packages/addons/driver/sundtek-mediatv/addon b/packages/addons/driver/sundtek-mediatv/addon new file mode 100755 index 0000000000..176c7ca208 --- /dev/null +++ b/packages/addons/driver/sundtek-mediatv/addon @@ -0,0 +1,34 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@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 +################################################################################ + +. config/options $1 + +mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/config/ + cp -P $PKG_DIR/config/* $ADDON_BUILD/$PKG_ADDON_ID/config/ + + cp -P $ROOT/$BUILD/sundtek_*/rootsys/sundtek_version.html $ADDON_BUILD/$PKG_ADDON_ID/ + +mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin/ + cp -Pa $ROOT/$BUILD/sundtek_*/rootsys/opt/bin/* $ADDON_BUILD/$PKG_ADDON_ID/bin/ + +mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib/ + cp -Pa $ROOT/$BUILD/sundtek_*/rootsys/opt/lib/*.so $ADDON_BUILD/$PKG_ADDON_ID/lib/ diff --git a/packages/addons/driver/sundtek-mediatv/changelog.txt b/packages/addons/driver/sundtek-mediatv/changelog.txt new file mode 100755 index 0000000000..64e4eecd42 --- /dev/null +++ b/packages/addons/driver/sundtek-mediatv/changelog.txt @@ -0,0 +1,2 @@ +1.90.0 +- initial version of Sundtek MediaTV DVB driver diff --git a/packages/addons/driver/sundtek-mediatv/config/device_attach_detach.sh b/packages/addons/driver/sundtek-mediatv/config/device_attach_detach.sh new file mode 100755 index 0000000000..3e31ba483f --- /dev/null +++ b/packages/addons/driver/sundtek-mediatv/config/device_attach_detach.sh @@ -0,0 +1,71 @@ +#!/bin/sh +# +# first argument: attach/detach +# second argument (DEVID - sequence number of device): 0/1/2/... + +. /etc/profile + +# which daemon to restart +TVHEADEND=1 +MUMUDVB=0 + +ADDON_DIR="/storage/.xbmc/addons/driver.dvb.sundtek-mediatv" +ADDON_HOME="/storage/.xbmc/userdata/addon_data/driver.dvb.sundtek-mediatv" +ATTACH_DETACH_LOG="$ADDON_HOME/attach_detach.log" + +wait_process() { + while [ -n "$(pidof $1)" ]; do + usleep 200000 + done +} + + echo "============================================================================" >>$ATTACH_DETACH_LOG + echo "Date: `date`" >>$ATTACH_DETACH_LOG + echo "Params: action=$1 devid=$2" >>$ATTACH_DETACH_LOG + + case "$1" in + attach) + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ADDON_DIR/lib + export LD_PRELOAD=$LD_PRELOAD:$ADDON_DIR/lib/libmediaclient.so + +( + # save adapter serial number (in background) + sleep 2 + serial_number=`mediaclient -e | awk '/ID:/ {print $2}'` + if [ ! -f $ADDON_HOME/adapter_serial_number.txt ]; then + echo -n "$serial_number" >$ADDON_HOME/adapter_serial_number.txt + else + serial_number_read=`cat $ADDON_HOME/adapter_serial_number.txt` + if [ "$serial_number_read" != "$serial_number" ]; then + echo -n "$serial_number" >$ADDON_HOME/adapter_serial_number.txt + fi + fi +)& + ;; + + detach) + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH//:$ADDON_DIR\/lib/} + export LD_PRELOAD=${LD_PRELOAD//:$ADDON_DIR\/lib\/libmediaclient.so/} + ;; + + *) + exit $NA + ;; + esac + + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >>$ATTACH_DETACH_LOG + echo "LD_PRELOAD=$LD_PRELOAD" >>$ATTACH_DETACH_LOG + + if [ "$TVHEADEND" = "1" -a -n "$(pidof tvheadend)" ]; then + echo "Restarting TVheadend..." >>$ATTACH_DETACH_LOG + sh /storage/.xbmc/addons/service.multimedia.hts-tvheadend/sleep.d/tvheadend.power suspend + wait_process tvheadend + sh /storage/.xbmc/addons/service.multimedia.hts-tvheadend/sleep.d/tvheadend.power resume + fi + + if [ "$MUMUDVB" = "1" -a -n "$(pidof mumudvb)" ]; then + echo "Restarting MuMuDVB..." >>$ATTACH_DETACH_LOG + sh /storage/.xbmc/addons/service.multimedia.mumudvb/sleep.d/mumudvb.power suspend + wait_process mumudvb + sh /storage/.xbmc/addons/service.multimedia.mumudvb/sleep.d/mumudvb.power resume + fi diff --git a/packages/addons/driver/sundtek-mediatv/config/sundtek.conf b/packages/addons/driver/sundtek-mediatv/config/sundtek.conf new file mode 100755 index 0000000000..1620e1365e --- /dev/null +++ b/packages/addons/driver/sundtek-mediatv/config/sundtek.conf @@ -0,0 +1,17 @@ +# +# sundtek.conf +# +# Call attach/detach script when new device appears/disappears +device_attach=/storage/.xbmc/userdata/addon_data/driver.dvb.sundtek-mediatv/device_attach_detach.sh attach DEVID +device_detach=/storage/.xbmc/userdata/addon_data/driver.dvb.sundtek-mediatv/device_attach_detach.sh detach DEVID + +# Infrared Control Support is disabled/enabled +ir_disabled=1 + +# Get adapter serial number with mediaclient -e +# or look into file adapter_serial_number.txt +[SERIALNUMBER] +# Choose initial DVB mode for hybrid DVB-T/DVB-C devices only +#initial_dvb_mode=[DVBC|DVBT] +# default mode is DVB-C, we must set it to DVB-T if needed +#initial_dvb_mode=DVBT diff --git a/packages/addons/driver/sundtek-mediatv/config/sundtek.conf.full b/packages/addons/driver/sundtek-mediatv/config/sundtek.conf.full new file mode 100755 index 0000000000..edb04439b4 --- /dev/null +++ b/packages/addons/driver/sundtek-mediatv/config/sundtek.conf.full @@ -0,0 +1,75 @@ +# +# sundtek.conf +# +# ----- GLOBAL SECTION ----- +#Set loglevel for logging to /var/log/mediasrv.log +#loglevel=[off|max] +#default: min +#max .. little bit more debug +#loglevel=off +loglevel=max + +#Call attach script when new device appears +#device_attach=[PATH_TO_SCRIPT] [PARAMETER|DEVID] #"DEVID" will automatically be replaced with the device ID +device_attach=/opt/bin/restartAddons.sh + +#Call detach script when device disappears +#device_detach=[PATH_TO_SCRIPT] [PARAMETER|DEVID] #"DEVID" will automatically be replaced with the device ID + +#Infrared Control Support is disabled/disabled +ir_disabled=1 + +#Enable listening on network +#enablenetwork=[on|off] +#default: off + +#Lowest adapter number to start with, e.g. /dev/dvb/adapter5/frontend0 +#first_adapter=5 + + +# ----- Section for adapter with [SERIALNUMBER] ----- +#Get adapter serial number with /opt/bin/mediaclient -e +#[SERIALNUMBER] + +#Description register as dreambox tuner +#dreambox_support_fe1=[on|off] +#default: off + +#Infrared protocol to use +#ir_protocol=[RC5|NEC|RC6] +#default: NEC + +#Keymap to use, e.g. "/lib/udev/rc_keymaps/vp702x" +#rcmap=[PATH_TO_KEYMAP] +#default: keymap which comes with the device + +#Choose initial DVB mode for hybrid DVB-T/DVB-C devices only +#initial_dvb_mode=[DVBC|DVBT] + +#Call attach script when new device appears +#device_attach=[PATH_TO_SCRIPT] [PARAMETER|DEVID] +#"DEVID" will automatically be replaced with the device ID + +#Call detach script when device disappears +#device_detach=[PATH_TO_SCRIPT] [PARAMETER|DEVID] +#"DEVID" will automatically be replaced with the device ID + +#Volume level +#volume=[0-127] #default: 118 + + +# WSS callback (see http://en.wikipedia.org/wiki/Widescreen_signaling) +# trigger script when the videoformat changes between 16:9 or 4:3 +#wss_callback=[scriptname] +# WSS_4_3_FULL +# WSS_14_9_LETTERBOX_CENTRE +# WSS_14_9_LETTERBOX_TOP +# WSS_16_9_LETTERBOX_CENTRE +# WSS_16_9_LETTERBOX_TOP +# WSS_16_9_LETTERBOX_DEEPER +# WSS_14_9_FULL_HEIGHT_4_3 +# WSS_16_9_FULL_HEIGHT_16_9 +# WSS_UNABLE_TO_DEMODULATE + +#Timeout in ms after that WSS_UNABLE_TO_DEMODULATE will be called +#wss_demodulation_timeout=[MILLISECONDS] diff --git a/packages/addons/driver/sundtek-mediatv/icon/icon.png b/packages/addons/driver/sundtek-mediatv/icon/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..912c71d6b9b26c9ea7bc1a92d8f8368a5090c8fe GIT binary patch literal 2806 zcmYjSc{tQx7r&I0Ez6*ys1OE;vHpanA;yrzG$fTJvTrdoDNM@`i5ilvh_uYuvNxte z$`V;q#?Z_l454qdd~4px`~LCX=iGbG^Lak!oX@%UKF|Hv+3Ap^*fuc$fTX=0#znAq z3Z~A+b%Isy!Fv$^)&XantIc}h_2eXSTT2@TjbXC6!P#(0aS4pZP+MSFcs;ZXaf?d^ z`v-l!ec>x)*xQ#m1*z>)gS2&^>Ke*T3e?`_>f)N;#H*>UVSZ#rM@I7mHp}DTU7?>a zFPp-hg-`}4dOrl2TQC`PUOcJ0vpc^DM#v)4Qqpi(9CwOGeN2UA5xiv>>K_aa3?5{| z`MLR?9-j0jI`1Qs6i-h z00sASmo!0eWHh|MgFHOpKQNq|&s%_*EFNTO!E2&J2_)teEFmR9zCvzmZ^PJPxNL58 zAzbpH1h&Oc+hJ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kNg`~WX}(c zito*&-LHg_bOvsSbl0^=E4gZ(Mi@1%+kVpVKHjyz*uT+>VtIY~(Ia(U20!@~?=Irg zUaOI*AWf~K($`xu15ZN%Ar_so#fmvT5&!h3%gGOs9&MQw8;U#1+YddzH4r0#^fbjO zm>=B{6ezc27Pmh*+WW-myBF_@clHM5TbreG)^|oIKUdY{i!66Y@4U~vr}g(gx3_V^ Jl%r22{RiCcNF4wG literal 0 HcmV?d00001 diff --git a/packages/addons/driver/sundtek-mediatv/meta b/packages/addons/driver/sundtek-mediatv/meta new file mode 100755 index 0000000000..0e08612c93 --- /dev/null +++ b/packages/addons/driver/sundtek-mediatv/meta @@ -0,0 +1,36 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@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 +################################################################################ + +PKG_NAME="sundtek-mediatv" +PKG_VERSION="1.90" +PKG_REV="0" +PKG_ARCH="any" +PKG_LICENSE="nonfree" +PKG_SITE="http://support.sundtek.com/" +PKG_URL="" +PKG_DEPENDS="sundtek" +PKG_BUILD_DEPENDS="toolchain sundtek" +PKG_PRIORITY="optional" +PKG_SECTION="driver/dvb" +PKG_SHORTDESC="Sundtek USB Stick DVB userspace driver" +PKG_LONGDESC="Driver for Sundtek MediaTV Pro (DVB-C, DVB-T, AnalogTV, Composite, S-Video, FM-Radio USB Stick) and Sundtek SkyTV Ultimate (DVB-S/S2 USB)." +PKG_IS_ADDON="yes" +PKG_ADDON_TYPE="xbmc.service" +PKG_AUTORECONF="no" diff --git a/packages/addons/driver/sundtek-mediatv/source/bin/sundtek-mediatv.service b/packages/addons/driver/sundtek-mediatv/source/bin/sundtek-mediatv.service new file mode 100755 index 0000000000..f6ff92eec7 --- /dev/null +++ b/packages/addons/driver/sundtek-mediatv/source/bin/sundtek-mediatv.service @@ -0,0 +1,48 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@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 +################################################################################ + +ADDON_DIR="$HOME/.xbmc/addons/driver.dvb.sundtek-mediatv" +ADDON_HOME="$HOME/.xbmc/userdata/addon_data/driver.dvb.sundtek-mediatv" +SUNDTEK_CONFIG_FILE="$ADDON_HOME/sundtek.conf" + +mkdir -p $ADDON_HOME + +if [ ! -f "$SUNDTEK_CONFIG_FILE" ]; then + cp $ADDON_DIR/config/* $ADDON_HOME/ +fi + +if [ ! -f "$ADDON_HOME/device_attach_detach.sh" ]; then + cp $ADDON_DIR/scripts/* $ADDON_HOME/ + chmod +x $ADDON_HOME/*.sh +fi + +if [ ! -x "$ADDON_HOME/device_attach_detach.sh" ]; then + chmod +x $ADDON_HOME/device_attach_detach.sh +fi + +SUNDTEK_ARG="--pluginpath=$ADDON_DIR/bin --daemon" + +if [ -z "$(pidof mediasrv)" ]; then + rm $ADDON_HOME/attach_detach.log + ln -sf $SUNDTEK_CONFIG_FILE /tmp/sundtek.conf + mediasrv $SUNDTEK_ARG +fi diff --git a/packages/addons/driver/sundtek-mediatv/source/default.py b/packages/addons/driver/sundtek-mediatv/source/default.py new file mode 100755 index 0000000000..8d040571ca --- /dev/null +++ b/packages/addons/driver/sundtek-mediatv/source/default.py @@ -0,0 +1,23 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@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 +################################################################################ + +import xbmc, time, os, subprocess + +os.system("sundtek-mediatv.service") diff --git a/packages/addons/driver/sundtek-mediatv/source/sleep.d/sundtek-mediatv.power b/packages/addons/driver/sundtek-mediatv/source/sleep.d/sundtek-mediatv.power new file mode 100755 index 0000000000..5f6dcd8ac6 --- /dev/null +++ b/packages/addons/driver/sundtek-mediatv/source/sleep.d/sundtek-mediatv.power @@ -0,0 +1,48 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@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 +################################################################################ + +. /etc/profile + +LOCKDIR="/var/lock/" +LOCKFILE="sundtek-mediatv" + +case "$1" in + hibernate|suspend) + if [ -n "$(pidof mediasrv)" ]; then + progress "Shutting down Sundtek MediaTV DVB driver for suspending..." + mkdir -p "$LOCKDIR" + touch "$LOCKDIR/${LOCKFILE}" + mediaclient --shutdown + fi + ;; + + thaw|resume) + if [ -f "$LOCKDIR/${LOCKFILE}" ]; then + progress "Restarting Sundtek MediaTV DVB driver for wakeup..." + sundtek-mediatv.service + rm -rf "$LOCKDIR/${LOCKFILE}" + fi + ;; + + *) exit $NA + ;; +esac