Sonntag, 8. September 2013

TVHeadend auf der dockstar installieren

TVHeadend auf der dockstar installieren

Ein fertiges TVHeadend-Paket für die dockstar (mit ARM-CPU) gibt es leider nicht, daher muss man kompilieren, was in diesem Fall aber nicht besonders schwer ist, da u.a. keine Patches erforderlich sind.

Eigentlich steht alles hier:

Da die Quellen (sources) auf git-Servern liegen, muss man git installieren.
apt-get install git libssl-dev pkg-config
(libssl-dev und pkg-config benötigen wir später zum kompilieren)
Der Link oben verrät uns die genaue Adresse des Servers wo die Sourcen liegen. in unserem Fall: 
https://github.com/tvheadend/tvheadend.git

und mit
cd /usr/src
git clone https://github.com/tvheadend/tvheadend.git
spiegelt git uns die Quellen auf unsere Festplatte oder unseren USB-Stick.

Sollte es die Fehlermeldung
error: Problem with the SSL CA cert (path? access rights?) while accessing https://github.com/tvheadend/tvheadend.git/info/refs
fatal: HTTP request failed
geben, einfach die Prüfung deaktivieren mit
git config --global http.sslVerify false

Nun machen wir uns ans kompilieren, was nur funktioniert, wenn wir die folgenden Pakete installieren/installiert haben:
apt-get install build-essential linux-headers
Anmerkung:
In meinem Fall habe ich Kernel und Headers (3.9.5) manuell installiert
-> siehe http://lowbudget-modding.blogspot.com/2013/07/linuxtreiber-fur-dvb-t-stick-msi-digi.html

Nun wird ganz unkompliziert kompiliert und installiert:

cd tvheadend
./configure

das sollte dann in etwa so aussehen:

root@debian:/usr/src/tvheadend# ./configure
Checking support/features
  checking for cc execinfo.h ...                    ok
  checking for cc -mmmx ...                         fail
  checking for cc -msse2 ...                        fail
  checking for cc getloadavg ...                    ok
  checking for cc atomic64 ...                      fail
WARN: no python binary found
  checking for py module gzip ...                   fail
  checking for bzip2 ...                            ok
  checking for pkg openssl  ...                     ok
  checking for pkg zlib  ...                        ok
  checking for pkg avahi-client  ...                fail
  checking for pkg libavcodec <=55.0.0 ...          fail
  checking for cc sys/inotify.h ...                 ok
  checking for pkg libcurl  ...                     fail
  fetching dvb-scan files ...                       ok
Compiler:
  Using C compiler:                        cc
  Build for arch:                          armv5tel
Binaries:
  Using PYTHON:                            python
Options:
  cwc                                      yes
  v4l                                      yes
  linuxdvb                                 yes
  dvbscan                                  yes
  timeshift                                yes
  trace                                    yes
  imagecache                               no
  avahi                                    no
  zlib                                     yes
  libav                                    no
  inotify                                  yes
  bundle                                   no
  dvbcsa                                   no
  epoll                                    yes
  kqueue                                   no
  execinfo                                 yes
  getloadavg                               yes
  bin_bzip2                                yes
  ssl                                      yes
  inotify_h                                yes
Packages:
  openssl                                  0.9.8o
  zlib                                     1.2.3.4
Installation paths:
  Prefix:                                  /usr/local
  Binaries:                                ${prefix}/bin
  Libraries:                               ${prefix}/lib
  Data files:                              ${prefix}/share
  Man pages:                               ${datadir}/man
Final Binary:
  /usr/src/tvheadend/build.linux/tvheadend
Tvheadend Data Directory:
  /usr/local/share/tvheadend
root@debian:/usr/src/tvheadend#

dann
make
und am Ende ein
make install
eingeben.

Die kompilierte bin-Datei liegt in
usr/local/bin
und muss nach
/usr/bin
verschoben werden (oder man passt das folgende script an):

#! /bin/sh
### BEGIN INIT INFO
# Provides:          tvheadend
# Required-Start:    $local_fs $remote_fs udev
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO
 
# Author: Andreas Öman
 
# Do NOT "set -e"
 
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/usr/sbin:/usr/bin:/sbin:/bin
DESC="HTS Tvheadend"
NAME=tvheadend
DAEMON=/usr/bin/$NAME
DAEMON_ARGS="-f -u hts -g video"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
 
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
 
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS
 
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
 
#
# Function that starts the daemon/service
#
do_start()
{
 # Return
 #   0 if daemon has been started
 #   1 if daemon was already running
 #   2 if daemon could not be started
        udevadm settle
 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
  || return 1
 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
  $DAEMON_ARGS \
  || return 2
}
 
#
# Function that stops the daemon/service
#
do_stop()
{
 # Return
 #   0 if daemon has been stopped
 #   1 if daemon was already stopped
 #   2 if daemon could not be stopped
 #   other if a failure occurred
 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
 RETVAL="$?"
 [ "$RETVAL" = 2 ] && return 2
 # Many daemons don't delete their pidfiles when they exit.
 rm -f $PIDFILE
 return "$RETVAL"
}
 
 
case "$1" in
  start)
 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
 do_start
 case "$?" in
  0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 esac
 ;;
  stop)
 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
 do_stop
 case "$?" in
  0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 esac
 ;;
  restart|force-reload)
 #
 # If the "reload" option is implemented then remove the
 # 'force-reload' alias
 #
 log_daemon_msg "Restarting $DESC" "$NAME"
 do_stop
 case "$?" in
   0|1)
  do_start
  case "$?" in
   0) log_end_msg 0 ;;
   1) log_end_msg 1 ;; # Old process is still running
   *) log_end_msg 1 ;; # Failed to start
  esac
  ;;
   *)
    # Failed to stop
  log_end_msg 1
  ;;
 esac
 ;;
  *)
 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
 exit 3
 ;;
esac
 
:
Das Script in die neu erstellte Datei etc/init.d/ tvheadend kopieren.

Beim ersten Satrt müsst ihr hinter "DAEMON_ARGS="-f -u hts -g video" noch ein "-C" (ohne "") setzen.
Erst wenn ihr den access konfiguriert habt, könnt ih as wieder rausnehmen. 
chmod +x /etc/init.d/tvheadend
update-rc.d tvheadend defaults
Bevor ihr jetzt tvheadend per script startet oder den PC/dockstar neustartet, müsst ihr den user hts anlegen und zwar mit 
adduser –system –group –shell /bin/bash –home /home/hts hts
Das war's...








Keine Kommentare:

Kommentar veröffentlichen