15
2019
06

centos7.6 系统安装DVB驱动和TVHeadend

centos7.6 系统下载:http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-Minimal-1810.iso


安装完成后要升级内核哦。


yum install -y wget perl 

wget http://down.52itv.cn/my/kernel-ml-4.13.11-1.el7.elrepo.x86_64.rpm

wget http://down.52itv.cn/my/kernel-ml-devel-4.13.11-1.el7.elrepo.x86_64.rpm

rpm -i kernel-ml-4.13.11-1.el7.elrepo.x86_64.rpm

rpm -i kernel-ml-devel-4.13.11-1.el7.elrepo.x86_64.rpm

grub2-set-default 0

grub2-mkconfig -o /etc/grub2.cfg

reboot


重启后删除旧版本内核

rpm -qa | grep kernel #查看内核列表

#yum remove -y 要删除的内核名


继续下载安装,需要卸载旧版本的 kernel-ml-headers 和 kernel-ml-tools-libs


yum remove -y kernel-tools-libs kernel-tools kernel-headers kernel

wget http://down.52itv.cn/my/kernel-ml-headers-4.13.11-1.el7.elrepo.x86_64.rpm

wget http://down.52itv.cn/my/kernel-ml-tools-libs-4.13.11-1.el7.elrepo.x86_64.rpm

rpm -i kernel-ml-headers-4.13.11-1.el7.elrepo.x86_64.rpm

rpm -i kernel-ml-tools-libs-4.13.11-1.el7.elrepo.x86_64.rpm


安装完成 内核就升级完成,

安装DVB驱动。以TBS的接收卡为例。


cd /opt

yum -y install bzip2 git gcc unzip perl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker patchutils patch

wget http://down.52itv.cn/my/Digest-SHA-5.93.tar.gz

tar xvf Digest-SHA-5.93.tar.gz

rm -rf Digest-SHA-5.93.tar.gz

cd Digest-SHA-5.93

perl Makefile.PL

make -j4

make install

cd ..

rm -rf Digest-SHA-5.93

wget http://down.52itv.cn/my/perl-proc-processtable-master.zip

unzip -o perl-proc-processtable-master.zip > /dev/null 2>&1

rm -rf perl-proc-processtable-master.zip

cd perl-proc-processtable-master

perl Makefile.PL

make -j4

make install

cd ..

rm -rf perl-proc-processtable-master

wget http://down.52itv.cn/my/media_build.zip

unzip -o media_build.zip > /dev/null 2>&1

rm -rf media_build.zip

cd opt/media_build

make dir DIR=../media

make allyesconfig

make -j4

make install

cd ../..

wget http://down.52itv.cn/my/tbs-tuner-firmwares_v1.0.tar.bz2

tar jxvf tbs-tuner-firmwares_v1.0.tar.bz2 -C /lib/firmware/

rm -rf tbs-tuner-firmwares_v1.0.tar.bz2


等待编译安装完毕,安装完毕后重启系统 # reboot


我们在安装tvheadend .


yum install -y unzip gcc cmake bzip2 openssl-devel pcre-devel pcre2-devel avahi-devel libstdc++-static

if [ ! -f "/lib64/libiconv.so.2" ]; then

rm -rf libiconv-1.16.tar.gz

wget http://down.52itv.cn/my/libiconv-1.16.tar.gz

tar -zxvf libiconv-1.16.tar.gz

rm -rf libiconv-1.16.tar.gz

cd libiconv-1.16

./configure

make

make install

ln -s /usr/local/lib/libiconv.so.2 /lib64/libiconv.so.2

cd ..

rm -rf libiconv-1.16

fi

if [ ! -f "/lib64/libdvbcsa.so.1" ]; then

rm -rf libdvbcsa-1.1.0.tar.gz

wget http://down.52itv.cn/my/libdvbcsa-1.1.0.tar.gz

tar -zxvf libdvbcsa-1.1.0.tar.gz

rm -rf libdvbcsa-1.1.0.tar.gz

cd libdvbcsa-1.1.0

./configure

make

make install

ln -s /usr/local/lib/libdvbcsa.so.1 /lib64/libdvbcsa.so.1

cd ..

rm -rf libdvbcsa-1.1.0

fi

rm -rf tvheadends.zip

wget http://down.52itv.cn/my/tvheadends.zip

unzip -o tvheadends.zip > /dev/null 2>&1

rm -rf tvheadends.zip

cd tvheadend

./configure

make -j4

make install


编译完成后就OK了。

自动启动脚本


cat > /etc/init.d/tvh <<EOF

#!/bin/bash

# 级别

#chkconfig: 2345 80 90

# 描述

#description:tvheadend service

# 进程名

#processname:tvheadend-service


TVH_RUN=/usr/local/bin/tvheadend


start()

{

    stop

    if [ -f "\$TVH_RUN" ]; then

    echo -n \$"Starting \$prog: "

    \$TVH_RUN -u root -C >/dev/null 2>&1 &

    echo -e "\033[32m tvheadend run success \033[0m"

    fi

}


stop()

{

    pid=\`ps -ef |grep \$TVH_RUN |grep -v grep | awk '{print \$2}'\`

    if [ "\$pid" != "" ]; then

    echo -n \$"Stopping \$prog: "

    kill -9 \$pid

    echo -e "\033[34m tvheadend has stopped. \033[0m"

    fi

}

 

restart()

{

    start

}

 

case "\$1" in

    start)

    start

    ;;

    stop)

    stop

    ;;

    restart)

    restart

    ;;

    *)

    echo \$"Usage: \$0 {start|stop|restart}"

    RETVAL=1

esac

exit \$RETVAL

EOF

chmod 755 /etc/init.d/tvh

chkconfig --add tvh

chkconfig tvh on


#输入此命令启动服务

service tvh start


默认端口是:  9981 ,初次进入初始化设置账户和密码选择DVB驱动卡等待。


oscam 下次再说。。。


完毕。。。



« 上一篇