基于OMV系统集成Kodi的安装教程

OMV全称是Openmediavault,算是FreeNAS的一个分支,OMV基于debian,是目前应用最广的Linux发行版本,另一个比较著名的Linux发行版本Ubuntu也是基于debian的!装OMV的好处是,除了作为NAS以外,装上X以后,基本可以当一台正常的电脑用。

 

、debian base system

1、下载debian的ISO,OMV目前用的wheezy版本,所以下载7.10的iso,地址
http://cdimage.debian.org/mirror/cdimage/archive/7.10.0/i386/iso-cd/

下载netinst.iso  的版本即可

用unetbootin刻录到优盘,然后用BOOTICE激活

2、安装只选择SSH和标准工具

3、进ssh,修改apt的源

7.x

wget http://mirrors.163.com/.help/sources.list.wheezy

mv /etc/apt/sources.list /etc/apt/sources.list.bak

mv sources.list.wheezy /etc/apt/sources.list


4、添加OMV的源

稳定版本的源,添加这个即可
echo "deb http://packages.openmediavault.org/public stoneburner  main" > /etc/apt/sources.list.d/openmediavault.list

测试版本的源,这个备用,下次折腾的时候再说
echo "deb http://packages.openmediavault.org/public erasmus main" > /etc/apt/sources.list.d/openmediavault.list

5、禁用ipv6
echo net.ipv6.conf.all.disable_ipv6=1 > /etc/sysctl.d/disableipv6.conf

二、openmediavault的安装

apt-get update

apt-get install openmediavault-keyring postfix

出现 Postfix Configuration选择的时候,选择No configuration.

apt-get update
apt-get install openmediavault

出现Configuring mdadm的时候,键入none.
Do you want to start MD arrays automatically?选择 YES
When the 'ProFTPD configuration' dialogue is displayed choose 选择 standalone.

omv-initsystem
reboot

命令omv-release-upgrade,升级现有软件

OMV安装完成

开启openmediavault的web页面,默认用户名admin,密码是openmediavault,开启ssh服务

如果出现错误,在实体机键盘上键入

echo "[]" > /var/lib/openmediavault/dirtymodules.json

键入之后,错误不再出现

openmediavault完成

三、kodi的安装

1、基础组件

omv-update


apt-get install python-software-properties pkg-config


apt-get install software-properties-common


apt-get install freeglut3 freeglut3-dev libdrm-dev doxygen swig git-core
apt-transport-https



- For intel graphics:


apt-get install xorg xserver-xorg-video-intel libva-intel-vaapi-driver




- For amd graphics:


apt-get install xorg xserver-xorg-video-ati




apt-get install automake autopoint bison build-essential ccache cmake curl cvs default-jre fp-compiler gawk gdc gettext gperf libasound2-dev libass-dev libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libbluetooth-dev libbluray-dev libbluray1 libboost-dev libboost-thread-dev libbz2-dev libcap-dev libcdio-dev libcec-dev libcec1 libcrystalhd-dev libcrystalhd3 libcurl3 libcurl4-gnutls-dev libcwiid-dev libcwiid1 libdbus-1-dev libenca-dev libflac-dev libfontconfig-dev libfreetype6-dev libfribidi-dev libglew-dev libiso9660-dev libjasper-dev libjpeg-dev libltdl-dev liblzo2-dev libmad0-dev libmicrohttpd-dev libmodplug-dev libmp3lame-dev libmpeg2-4-dev libmpeg3-dev libmysqlclient-dev libnfs-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libpostproc-dev libpulse-dev libsamplerate-dev libsdl-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libshairport-dev libsmbclient-dev libsqlite3-dev libssh-dev libssl-dev libswscale-dev libtiff-dev libtinyxml-dev libtool libudev-dev libusb-dev libva-dev libva-egl1 libva-tpi1 libvdpau-dev libvorbisenc2 libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev libyajl-dev mesa-utils nasm pmount python-dev python-imaging python-sqlite unzip yasm zip zlib1g-dev uuid-dev

2、kodi部分

修改kodi的源,添加到apt的源文件里,也可以不添加

# XBMC repos
deb https://people.debian.org/~rbalint/ppa/xbmc-ffmpeg xbmc-ffmpeg-unstable/
deb http://http.debian.net/debian unstable main

wget https://github.com/xbmc/xbmc/archive/16.1-Jarvis.tar.gz

tar zxvf 16.1-Jarvis.tar.gz

apt-get remove libtag1-dev
make -C lib/taglib
make -C lib/taglib install
./bootstrap
./configure

出现错误:

configure: error: libdcadec not found


解决办法:


make -C tools/depends/target/libdcadec PREFIX=/usr/local



出现错误:
configure: libuuid not found   

解决办法:

apt-get install uuid-dev


出现错误:
checking "for libcrossguid"... configure: error: crossguid not found

解决办法:

make -C tools/depends/target/crossguid/ PREFIX=/usr/local



安装:


make
make install

3、开机自动启动脚本部分

touch /etc/init.d/kodi
chmod a+x /etc/init.d/kodi

nano

/etc/init.d/kodi



脚本如下

#! /bin/sh

### BEGIN INIT INFO
# Provides:          kodi
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts instance of Kodi
# Description:       starts instance of Kodi using start-stop-daemon and xinit
### END INIT INFO

############### EDIT ME ##################

# path to xinit exec
DAEMON=/usr/bin/xinit

# startup args
DAEMON_OPTS=" /usr/local/bin/kodi-standalone -- :0"

# script name
NAME=kodi

# app name
DESC=Kodi

# user
RUN_AS=root

# Path of the PID file
PID_FILE=/var/run/kodi.pid

############### END EDIT ME ##################

test -x $DAEMON || exit 0

set -e

case "$1" in
  start)
        echo "Starting $DESC"
        start-stop-daemon --start -c $RUN_AS --background --pidfile $PID_FILE  --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
        ;;
  stop)
        echo "Stopping $DESC"
        start-stop-daemon --stop --pidfile $PID_FILE
        ;;

  restart|force-reload)
        echo "Restarting $DESC"
        start-stop-daemon --stop --pidfile $PID_FILE
        sleep 5
        start-stop-daemon --start -c $RUN_AS --background --pidfile $PID_FILE  --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0



在实体机上测试
/etc/init.d/kodi start
是否可以,如果可以的话,键入update-rc.d kodi defaults自动开机启动,完成KODI安装部分完成
四、aria2编译部分apt-get updateapt-get install autoconf automake libcppunit-dev autopoint openssl libtool sphinx-common sphinxsearch libgcrypt11-dev libxml2-dev pkg-config build-essential g++https://github.com/aria2/aria2/releases/download/release-1.22.0/aria2-1.22.0.tar.gz

tar zxvf aria2-1.22.0.tar.gz
autoreconf -i ./configuremakemake install