From a76fa009f833a040e7a77cbf368fd8936e4ca68a Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 2 Jan 2012 10:58:19 +0100 Subject: [PATCH] linux: HDHomeRun TV tuner DVB driver and belonging addon --- config/functions | 12 ++-- packages/3rdparty/driver/dvbhdhomerun/build | 13 ++++ packages/3rdparty/driver/dvbhdhomerun/meta | 35 ++++++++++ .../dvbhdhomerun-0.0.9-001-conf_file.patch | 51 ++++++++++++++ .../dvbhdhomerun-0.0.9-002-auto_detect.patch | 34 ++++++++++ packages/3rdparty/lib/libhdhomerun/build | 7 ++ packages/3rdparty/lib/libhdhomerun/meta | 35 ++++++++++ packages/3rdparty/lib/libhdhomerun/rename | 6 ++ packages/addons/driver/hdhomerun/addon | 33 ++++++++++ .../addons/driver/hdhomerun/changelog.txt | 2 + .../hdhomerun/config/dvbhdhomerun.sample | 16 +++++ .../hdhomerun/config/userhdhomerun-started.sh | 34 ++++++++++ .../addons/driver/hdhomerun/icon/icon.png | Bin 0 -> 4803 bytes packages/addons/driver/hdhomerun/meta | 36 ++++++++++ .../hdhomerun/source/bin/hdhomerun.service | 62 ++++++++++++++++++ .../addons/driver/hdhomerun/source/default.py | 32 +++++++++ .../hdhomerun/source/sleep.d/hdhomerun.power | 48 ++++++++++++++ packages/linux-drivers/hdhomerun-driver/build | 10 +++ .../linux-drivers/hdhomerun-driver/install | 28 ++++++++ packages/linux-drivers/hdhomerun-driver/meta | 35 ++++++++++ projects/ATV/options | 2 +- projects/Fusion/options | 2 +- projects/Generic/options | 2 +- projects/Generic_OSS/options | 2 +- projects/ION/options | 2 +- projects/Intel/options | 2 +- projects/Ultra/options | 2 +- 27 files changed, 531 insertions(+), 12 deletions(-) create mode 100755 packages/3rdparty/driver/dvbhdhomerun/build create mode 100644 packages/3rdparty/driver/dvbhdhomerun/meta create mode 100644 packages/3rdparty/driver/dvbhdhomerun/patches/dvbhdhomerun-0.0.9-001-conf_file.patch create mode 100644 packages/3rdparty/driver/dvbhdhomerun/patches/dvbhdhomerun-0.0.9-002-auto_detect.patch create mode 100755 packages/3rdparty/lib/libhdhomerun/build create mode 100644 packages/3rdparty/lib/libhdhomerun/meta create mode 100755 packages/3rdparty/lib/libhdhomerun/rename create mode 100755 packages/addons/driver/hdhomerun/addon create mode 100644 packages/addons/driver/hdhomerun/changelog.txt create mode 100644 packages/addons/driver/hdhomerun/config/dvbhdhomerun.sample create mode 100644 packages/addons/driver/hdhomerun/config/userhdhomerun-started.sh create mode 100644 packages/addons/driver/hdhomerun/icon/icon.png create mode 100644 packages/addons/driver/hdhomerun/meta create mode 100755 packages/addons/driver/hdhomerun/source/bin/hdhomerun.service create mode 100755 packages/addons/driver/hdhomerun/source/default.py create mode 100755 packages/addons/driver/hdhomerun/source/sleep.d/hdhomerun.power create mode 100755 packages/linux-drivers/hdhomerun-driver/build create mode 100755 packages/linux-drivers/hdhomerun-driver/install create mode 100644 packages/linux-drivers/hdhomerun-driver/meta 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 0000000000000000000000000000000000000000..3e86018bdd7edf031d927c7500442805ed5c0c03 GIT binary patch literal 4803 zcmV;!5KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1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&cF zR%gVe_T3|_ZA_ht0LIU-Nh#%INAyJxj~HTSx(y_qfQi77ipaGf@=%3z%tthHcj@@w=(N)tkyjXLjb- zYoDpxwN1J#Np+oR$Y;+FV`8mYVlv6-QkFPAI+n~Fqv&YQXCcJt3#t6yqU3C}#h?cF z9=1W_U+1!i}qPg8KZ|#!~ dr58m18vyPZO!cb3Y&QS^002ovPDHLkV1m$LE-nB7 literal 0 HcmV?d00001 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)