diff --git a/config/functions b/config/functions index 65c788030b..e161f26cfd 100644 --- a/config/functions +++ b/config/functions @@ -179,13 +179,15 @@ fix_module_depends() { # modify .modinfo section in kernel module to depends on other required modules local MODULE="$1" local DEPENDS="$2" + local OLD_DEPENDS="" cp ${MODULE} ${MODULE}_orig $OBJDUMP -s -j .modinfo ${MODULE}_orig | awk 'BEGIN{v=0;} /Contents/ {v=1; next;} {if (v==1) print $0;}' >new.modinfo1 cat new.modinfo1 | cut -c7-41 | awk '{printf($0);}' | sed 's/ //g;s/../\\\x&/g;' >new.modinfo2 - /bin/echo -ne `cat new.modinfo2` >new.modinfo3 - cat new.modinfo3 | tr '\000' '\n' | awk '/^depends=/ {next;} {print $0;}' | tr '\n' '\000' >new.modinfo4 - /bin/echo -ne "depends=$DEPENDS\0" >>new.modinfo4 - $OBJCOPY --remove-section=.modinfo --add-section=.modinfo=new.modinfo4 --set-section-flags .modinfo=contents,alloc,load,readonly,data ${MODULE}_orig ${MODULE} + /bin/echo -ne `cat new.modinfo2` | tr '\000' '\n' >new.modinfo3 + cat new.modinfo3 | awk '/^depends=/ {next;} {print $0;}' | tr '\n' '\000' >new.modinfo + OLD_DEPENDS=$(awk '{FS="="} /depends=/ {print $2}' new.modinfo3) + [ -n "$OLD_DEPENDS" ] && DEPENDS="$OLD_DEPENDS,$DEPENDS" + /bin/echo -ne "depends=$DEPENDS\0" >>new.modinfo + $OBJCOPY --remove-section=.modinfo --add-section=.modinfo=new.modinfo --set-section-flags .modinfo=contents,alloc,load,readonly,data ${MODULE}_orig ${MODULE} rm new.modinfo* } - diff --git a/packages/3rdparty/driver/dvbhdhomerun/build b/packages/3rdparty/driver/dvbhdhomerun/build new file mode 100755 index 0000000000..29a695c40b --- /dev/null +++ b/packages/3rdparty/driver/dvbhdhomerun/build @@ -0,0 +1,13 @@ +#!/bin/sh + +. config/options $1 + +# absolute path +LIBHDHOMERUN_PATH=$(ls -d $ROOT/$BUILD/libhdhomerun_*/) + +cd $PKG_BUILD/userhdhomerun + +sed -i "s|SET(LIBHDHOMERUN_PATH .*)|SET(LIBHDHOMERUN_PATH $LIBHDHOMERUN_PATH)|g" CMakeLists.txt +sed -i "s|/etc/dvbhdhomerun|/tmp/dvbhdhomerun|g" hdhomerun_tuner.cpp + +make LDFLAGS="-lpthread" diff --git a/packages/3rdparty/driver/dvbhdhomerun/meta b/packages/3rdparty/driver/dvbhdhomerun/meta new file mode 100644 index 0000000000..f2283cc718 --- /dev/null +++ b/packages/3rdparty/driver/dvbhdhomerun/meta @@ -0,0 +1,35 @@ +################################################################################ +# 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="dvbhdhomerun" +PKG_VERSION="0.0.9" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://sourceforge.net/projects/dvbhdhomerun/" +PKG_URL="http://downloads.sourceforge.net/project/dvbhdhomerun/${PKG_NAME}_${PKG_VERSION}.tar.gz" +PKG_DEPENDS="" +PKG_BUILD_DEPENDS="toolchain libhdhomerun" +PKG_PRIORITY="optional" +PKG_SECTION="driver/dvb" +PKG_SHORTDESC="A linux DVB driver and userspace application for the HDHomeRun TV tuner (http://www.silicondust.com)." +PKG_LONGDESC="A linux DVB driver and userspace application for the HDHomeRun TV tuner (http://www.silicondust.com)." +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" diff --git a/packages/3rdparty/driver/dvbhdhomerun/patches/dvbhdhomerun-0.0.9-001-conf_file.patch b/packages/3rdparty/driver/dvbhdhomerun/patches/dvbhdhomerun-0.0.9-001-conf_file.patch new file mode 100644 index 0000000000..60f1a492f6 --- /dev/null +++ b/packages/3rdparty/driver/dvbhdhomerun/patches/dvbhdhomerun-0.0.9-001-conf_file.patch @@ -0,0 +1,51 @@ +diff -uNr dvbhdhomerun-0.0.9-orig/userhdhomerun/conf_inifile.cpp dvbhdhomerun-0.0.9/userhdhomerun/conf_inifile.cpp +--- dvbhdhomerun-0.0.9-orig/userhdhomerun/conf_inifile.cpp 2011-03-06 21:00:01.000000000 +0100 ++++ dvbhdhomerun-0.0.9/userhdhomerun/conf_inifile.cpp 2011-12-20 23:21:46.000000000 +0100 +@@ -8,6 +8,37 @@ + + using namespace std; + ++// http://stackoverflow.com/questions/6089231/getting-std-ifstream-to-handle-lf-cr-and-crlf ++std::istream& safeGetline(std::istream& is, std::string& t) ++{ ++ t.clear(); ++ ++ // The characters in the stream are read one-by-one using a std::streambuf. ++ // That is faster than reading them one-by-one using the std::istream. ++ // Code that uses streambuf this way must be guarded by a sentry object. ++ // The sentry object performs various tasks, ++ // such as thread synchronization and updating the stream state. ++ ++ std::istream::sentry se(is); ++ std::streambuf* sb = is.rdbuf(); ++ ++ for(;;) { ++ int c = sb->sbumpc(); ++ switch (c) { ++ case '\r': ++ c = sb->sgetc(); ++ if(c == '\n') ++ sb->sbumpc(); ++ return is; ++ case '\n': ++ case EOF: ++ return is; ++ default: ++ t += (char)c; ++ } ++ } ++} ++ + bool ConfIniFile::OpenIniFile(const string& _filename) + { + ifstream conffile; +@@ -15,7 +46,8 @@ + if(conffile.is_open()) { + string line; + string section; +- while(getline(conffile, line)) { ++ //while(getline(conffile, line)) { ++ while(safeGetline(conffile, line)) { + if(line.empty()) { + //LOG() << " ignore, empty"; + } diff --git a/packages/3rdparty/driver/dvbhdhomerun/patches/dvbhdhomerun-0.0.9-002-auto_detect.patch b/packages/3rdparty/driver/dvbhdhomerun/patches/dvbhdhomerun-0.0.9-002-auto_detect.patch new file mode 100644 index 0000000000..625fd4bf15 --- /dev/null +++ b/packages/3rdparty/driver/dvbhdhomerun/patches/dvbhdhomerun-0.0.9-002-auto_detect.patch @@ -0,0 +1,34 @@ +diff -uNr dvbhdhomerun-0.0.9-orig/userhdhomerun/hdhomerun_tuner.cpp dvbhdhomerun-0.0.9/userhdhomerun/hdhomerun_tuner.cpp +--- dvbhdhomerun-0.0.9-orig/userhdhomerun/hdhomerun_tuner.cpp 2011-03-06 21:00:01.000000000 +0100 ++++ dvbhdhomerun-0.0.9/userhdhomerun/hdhomerun_tuner.cpp 2011-12-21 09:12:03.000000000 +0100 +@@ -80,11 +80,29 @@ + string type(tmp); + LOG() << "Type of device: " << type << endl; + if(type == "hdhomerun_dvbt") { +- m_type = HdhomerunTuner::DVBC; ++ m_type = HdhomerunTuner::DVBT; + } + else if(type == "hdhomerun_atsc") { + m_type = HdhomerunTuner::ATSC; + } ++ else if(type == "hdhomerun3_dvbt") { ++ m_type = HdhomerunTuner::DVBT; ++ } ++ else if(type.find("dvbt") != string::npos) { ++ m_type = HdhomerunTuner::DVBT; ++ } ++ else if(type.find("dvbc") != string::npos) { ++ m_type = HdhomerunTuner::DVBC; ++ } ++ else if(type.find("atsc") != string::npos) { ++ m_type = HdhomerunTuner::ATSC; ++ } ++ ++ if (m_type != HdhomerunTuner::NOT_SET) { ++ LOG() << "Auto detecting tuner type set to \"" << type ++ << "\" based on auto detecting" << endl; ++ } ++ + } + else { + ERR() << "get_model_str from HDHomeRun failed!" << endl; diff --git a/packages/3rdparty/lib/libhdhomerun/build b/packages/3rdparty/lib/libhdhomerun/build new file mode 100755 index 0000000000..5c3fc562e1 --- /dev/null +++ b/packages/3rdparty/lib/libhdhomerun/build @@ -0,0 +1,7 @@ +#!/bin/sh + +. config/options $1 + +cd $PKG_BUILD + +make CROSS_COMPILE=$TARGET_PREFIX diff --git a/packages/3rdparty/lib/libhdhomerun/meta b/packages/3rdparty/lib/libhdhomerun/meta new file mode 100644 index 0000000000..94027e6e3d --- /dev/null +++ b/packages/3rdparty/lib/libhdhomerun/meta @@ -0,0 +1,35 @@ +################################################################################ +# 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="libhdhomerun" +PKG_VERSION="20111025" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="LGPL" +PKG_SITE="http://www.silicondust.com/products/hdhomerun/dvbt/" +PKG_URL="http://download.silicondust.com/hdhomerun/${PKG_NAME}_${PKG_VERSION}.tgz" +PKG_DEPENDS="" +PKG_BUILD_DEPENDS="toolchain" +PKG_PRIORITY="optional" +PKG_SECTION="driver" +PKG_SHORTDESC="The library provides functionality to setup the HDHomeRun, change channels, setup PID filtering, get signal quality and so on." +PKG_LONGDESC="The library provides functionality to setup the HDHomeRun, change channels, setup PID filtering, get signal quality and so on." +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" diff --git a/packages/3rdparty/lib/libhdhomerun/rename b/packages/3rdparty/lib/libhdhomerun/rename new file mode 100755 index 0000000000..82ea04c745 --- /dev/null +++ b/packages/3rdparty/lib/libhdhomerun/rename @@ -0,0 +1,6 @@ +#!/bin/sh + +. config/options $1 + +cd $BUILD +mv ${PKG_NAME} ${PKG_NAME}_${PKG_VERSION} diff --git a/packages/addons/driver/hdhomerun/addon b/packages/addons/driver/hdhomerun/addon new file mode 100755 index 0000000000..56c45f3c7f --- /dev/null +++ b/packages/addons/driver/hdhomerun/addon @@ -0,0 +1,33 @@ +#!/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/ + + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin/ + cp -Pa $BUILD/dvbhdhomerun-*/userhdhomerun/build/userhdhomerun $ADDON_BUILD/$PKG_ADDON_ID/bin/ + cp -Pa $BUILD/libhdhomerun_*/hdhomerun_config $ADDON_BUILD/$PKG_ADDON_ID/bin/ + + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib/ + cp -Pa $BUILD/libhdhomerun_*/libhdhomerun.so $ADDON_BUILD/$PKG_ADDON_ID/lib/ diff --git a/packages/addons/driver/hdhomerun/changelog.txt b/packages/addons/driver/hdhomerun/changelog.txt new file mode 100644 index 0000000000..e66a53169e --- /dev/null +++ b/packages/addons/driver/hdhomerun/changelog.txt @@ -0,0 +1,2 @@ +2.0.0 +- initial version of HDHomeRun driver diff --git a/packages/addons/driver/hdhomerun/config/dvbhdhomerun.sample b/packages/addons/driver/hdhomerun/config/dvbhdhomerun.sample new file mode 100644 index 0000000000..b2d5c473df --- /dev/null +++ b/packages/addons/driver/hdhomerun/config/dvbhdhomerun.sample @@ -0,0 +1,16 @@ +# +# /tmp/dvbhdhomerun +# +# Types can any of: +# DVB-C +# DVB-T +# ATSC + +# You can change the tuner type for each tuner on your HDHomeRun by +# exchanging the 1210E3DC-X with the serial number of your tuner: + +#[12109F6E-0] +#tuner_type=DVB-T + +#[12109F6E-1] +#tuner_type=DVB-T diff --git a/packages/addons/driver/hdhomerun/config/userhdhomerun-started.sh b/packages/addons/driver/hdhomerun/config/userhdhomerun-started.sh new file mode 100644 index 0000000000..75f6393899 --- /dev/null +++ b/packages/addons/driver/hdhomerun/config/userhdhomerun-started.sh @@ -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 +################################################################################ + + # this script is executed when userhdhomerun program is started + while [ -z "$(pidof userhdhomerun)" ]; do + usleep 200000 + done + usleep 500000 + + # restart the services + killall tvheadend + while [ -n "$(pidof tvheadend)" ]; do + usleep 200000 + done + tvheadend.service diff --git a/packages/addons/driver/hdhomerun/icon/icon.png b/packages/addons/driver/hdhomerun/icon/icon.png new file mode 100644 index 0000000000..3e86018bdd Binary files /dev/null and b/packages/addons/driver/hdhomerun/icon/icon.png differ diff --git a/packages/addons/driver/hdhomerun/meta b/packages/addons/driver/hdhomerun/meta new file mode 100644 index 0000000000..444a79bf94 --- /dev/null +++ b/packages/addons/driver/hdhomerun/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="hdhomerun" +PKG_VERSION="1.90" +PKG_REV="4" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://www.silicondust.com/products/hdhomerun/dvbt/" +PKG_URL="" +PKG_DEPENDS="" +PKG_BUILD_DEPENDS="toolchain libhdhomerun dvbhdhomerun" +PKG_PRIORITY="optional" +PKG_SECTION="driver/dvb" +PKG_SHORTDESC="A linux DVB driver for the HDHomeRun (http://www.silicondust.com)." +PKG_LONGDESC="A linux DVB driver for the HDHomeRun (http://www.silicondust.com)." +PKG_IS_ADDON="yes" +PKG_ADDON_TYPE="xbmc.service" +PKG_AUTORECONF="no" diff --git a/packages/addons/driver/hdhomerun/source/bin/hdhomerun.service b/packages/addons/driver/hdhomerun/source/bin/hdhomerun.service new file mode 100755 index 0000000000..ed7cf4ae05 --- /dev/null +++ b/packages/addons/driver/hdhomerun/source/bin/hdhomerun.service @@ -0,0 +1,62 @@ +#!/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_NAME="driver.dvb.hdhomerun" +ADDON_DIR="$HOME/.xbmc/addons/$ADDON_NAME" +ADDON_HOME="$HOME/.xbmc/userdata/addon_data/$ADDON_NAME" + +mkdir -p $ADDON_HOME + +if [ ! -f "$ADDON_HOME/dvbhdhomerun.sample" ]; then + cp $ADDON_DIR/config/* $ADDON_HOME/ +fi + +export LD_LIBRARY_PATH=$ADDON_DIR/lib:$LD_LIBRARY_PATH + +if [ -z "$(pidof userhdhomerun)" ]; then + rm -f /tmp/dvbhdhomerun + [ -f $ADDON_HOME/dvbhdhomerun ] && ln -s $ADDON_HOME/dvbhdhomerun /tmp/dvbhdhomerun + + modprobe dvb_hdhomerun + modprobe dvb_hdhomerun_fe + + mkdir -p /var/log/ + rm -f /var/log/dvbhdhomerun.log + + cd $ADDON_DIR/bin + userhdhomerun -f + sh $ADDON_HOME/userhdhomerun-started.sh >/dev/null 2>&1 & + +( + sleep 3 + + sn_old="dummy" + [ -f $ADDON_HOME/serial-number.txt ] && sn_old=$(cat $ADDON_HOME/serial-number.txt) + + sn_new=$(grep "Name of device: " /var/log/dvbhdhomerun.log) + + if [ "$sn_new" != "$sn_old" ]; then + grep "Name of device: " /var/log/dvbhdhomerun.log >$ADDON_HOME/serial-number.txt + fi +)& + +fi diff --git a/packages/addons/driver/hdhomerun/source/default.py b/packages/addons/driver/hdhomerun/source/default.py new file mode 100755 index 0000000000..51ae54d239 --- /dev/null +++ b/packages/addons/driver/hdhomerun/source/default.py @@ -0,0 +1,32 @@ +################################################################################ +# 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 os +import sys +import xbmcaddon + +__scriptname__ = "Driver for the HDHomeRun TV tuner" +__author__ = "OpenELEC" +__url__ = "http://www.openelec.tv" +__settings__ = xbmcaddon.Addon(id='driver.dvb.hdhomerun') +__cwd__ = __settings__.getAddonInfo('path') +__path__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "hdhomerun.service") ) + +os.system(__path__) diff --git a/packages/addons/driver/hdhomerun/source/sleep.d/hdhomerun.power b/packages/addons/driver/hdhomerun/source/sleep.d/hdhomerun.power new file mode 100755 index 0000000000..416d059066 --- /dev/null +++ b/packages/addons/driver/hdhomerun/source/sleep.d/hdhomerun.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="hdhomerun" + +case "$1" in + hibernate|suspend) + if [ -n "$(pidof userhdhomerun)" ]; then + progress "Shutting down HDHomeRun driver for suspending..." + mkdir -p "$LOCKDIR" + touch "$LOCKDIR/$LOCKFILE" + killall userhdhomerun + fi + ;; + + thaw|resume) + if [ -f "$LOCKDIR/$LOCKFILE" ]; then + progress "Restarting HDHomeRun driver for wakeup..." + hdhomerun.service + rm -rf "$LOCKDIR/$LOCKFILE" + fi + ;; + + *) exit $NA + ;; +esac diff --git a/packages/linux-drivers/hdhomerun-driver/build b/packages/linux-drivers/hdhomerun-driver/build new file mode 100755 index 0000000000..0fc606b9b1 --- /dev/null +++ b/packages/linux-drivers/hdhomerun-driver/build @@ -0,0 +1,10 @@ +#!/bin/sh + +. config/options $1 + +$SCRIPTS/unpack dvbhdhomerun + +cd $BUILD/dvbhdhomerun-*/kernel + +make dvb_hdhomerun KERNEL_DIR=$(kernel_path) +fix_module_depends dvb_hdhomerun_core.ko "dvb_core" diff --git a/packages/linux-drivers/hdhomerun-driver/install b/packages/linux-drivers/hdhomerun-driver/install new file mode 100755 index 0000000000..f655a93ece --- /dev/null +++ b/packages/linux-drivers/hdhomerun-driver/install @@ -0,0 +1,28 @@ +#!/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 + +VER=`ls $BUILD/linux*/modules/lib/modules` + +mkdir -p $INSTALL/lib/modules/$VER/hdhomerun +cp $BUILD/dvbhdhomerun-*/kernel/*.ko $INSTALL/lib/modules/$VER/hdhomerun/ diff --git a/packages/linux-drivers/hdhomerun-driver/meta b/packages/linux-drivers/hdhomerun-driver/meta new file mode 100644 index 0000000000..f9ab2e2e16 --- /dev/null +++ b/packages/linux-drivers/hdhomerun-driver/meta @@ -0,0 +1,35 @@ +################################################################################ +# 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="hdhomerun-driver" +PKG_VERSION="0.0.9" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://sourceforge.net/projects/dvbhdhomerun/" +PKG_URL="" +PKG_DEPENDS="" +PKG_BUILD_DEPENDS="toolchain linux" +PKG_PRIORITY="optional" +PKG_SECTION="driver/dvb" +PKG_SHORTDESC="A linux DVB driver for the HDHomeRun TV tuner (http://www.silicondust.com)." +PKG_LONGDESC="A linux DVB driver for the HDHomeRun TV tuner (http://www.silicondust.com)." +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" diff --git a/projects/ATV/options b/projects/ATV/options index f11a3eb966..c13e99d72d 100755 --- a/projects/ATV/options +++ b/projects/ATV/options @@ -160,7 +160,7 @@ # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" ADDITIONAL_DRIVERS="asix-ax887xx bcm_sta" if [ "$PVR" = yes ]; then - ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832" + ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832 hdhomerun-driver" fi # build with network support (yes / no) diff --git a/projects/Fusion/options b/projects/Fusion/options index 5d20f36e32..affdf44459 100755 --- a/projects/Fusion/options +++ b/projects/Fusion/options @@ -160,7 +160,7 @@ # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" ADDITIONAL_DRIVERS="asix-ax887xx" if [ "$PVR" = yes ]; then - ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832" + ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832 hdhomerun-driver" fi # build with network support (yes / no) diff --git a/projects/Generic/options b/projects/Generic/options index bbcb73ce6f..7e6bb96c6f 100755 --- a/projects/Generic/options +++ b/projects/Generic/options @@ -160,7 +160,7 @@ # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" ADDITIONAL_DRIVERS="asix-ax887xx" if [ "$PVR" = yes ]; then - ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832" + ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832 hdhomerun-driver" fi # build with network support (yes / no) diff --git a/projects/Generic_OSS/options b/projects/Generic_OSS/options index 7e44facc8e..bcedeb1622 100755 --- a/projects/Generic_OSS/options +++ b/projects/Generic_OSS/options @@ -160,7 +160,7 @@ # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" ADDITIONAL_DRIVERS="asix-ax887xx" if [ "$PVR" = yes ]; then - ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832" + ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832 hdhomerun-driver" fi # build with network support (yes / no) diff --git a/projects/ION/options b/projects/ION/options index e4178b0888..eadb474c12 100755 --- a/projects/ION/options +++ b/projects/ION/options @@ -160,7 +160,7 @@ # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" ADDITIONAL_DRIVERS="asix-ax887xx" if [ "$PVR" = yes ]; then - ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832" + ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832 hdhomerun-driver" fi # build with network support (yes / no) diff --git a/projects/Intel/options b/projects/Intel/options index a0a3c87734..d7c8fa4680 100755 --- a/projects/Intel/options +++ b/projects/Intel/options @@ -160,7 +160,7 @@ # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" ADDITIONAL_DRIVERS="asix-ax887xx" if [ "$PVR" = yes ]; then - ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832" + ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832 hdhomerun-driver" fi # build with network support (yes / no) diff --git a/projects/Ultra/options b/projects/Ultra/options index c91646f696..b1711ba659 100755 --- a/projects/Ultra/options +++ b/projects/Ultra/options @@ -160,7 +160,7 @@ # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" ADDITIONAL_DRIVERS="asix-ax887xx" if [ "$PVR" = yes ]; then - ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832" + ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832 hdhomerun-driver" fi # build with network support (yes / no)