[HOWTO] TVHeadend on unRAID 5 rc8a


Recommended Posts

Okay, so a while ago I was trying to get TVHeadend working with unRAID 5 rc8a. Since I'm a complete linux illiterate, I had no idea what I was doing, but after a lot of hair-pulling I actually got it working about a month ago.

 

I forgot to write a guide at the time, so writing it now I'm sure some of the commands are wrong/not needed. I have made a note(*) at the commands that I'm not sure are correct.

Before this has any potential to go in the wiki, someone should definitely proofread it (also, I have no idea what packages are actually needed - the ones below are the ones needed to install TVHeadend and VirtualBox (but the unRAID 5 plugin takes care of installing TVHeadend))!

 

Install the TVHeadend plugin: http://lime-technology.com/forum/index.php?topic=20782.0

 

SSH to your unRAID, create a temporary development directory and download the packages:

mkdir /mnt/cache/.unraiddev/packages_slack13.1.0
cd /mnt/cache/.unraiddev/packages_slack13.1.0
wget <links from below>

http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.4.11.tar.gz
http://lime-technology.com/download/doc_download/37-unraid-server-version-50-rc8a-aio
http://slackware.osuosl.org/slackware-13.1/slackware/d/gcc-4.4.4-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/l/glibc-2.11.1-i486-3.txz
http://slackware.osuosl.org/slackware-13.1/slackware/d/binutils-2.20.51.0.8-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/d/make-3.81-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/a/cxxlibs-6.0.13-i486-2.txz
http://slackware.osuosl.org/slackware-13.1/slackware/a/pkgtools-13.1-noarch-1.tgz
http://slackware.osuosl.org/slackware-13.1/slackware/d/perl-5.10.1-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/a/cpio-2.9-i486-2.txz
http://slackware.osuosl.org/slackware-13.1/slackware/a/patch-2.5.4-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/l/ncurses-5.7-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/d/git-1.7.1-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/l/libidn-1.5-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/n/curl-7.20.1-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/d/pkg-config-0.23-i486-2.txz
http://slackware.osuosl.org/slackware-13.1/slackware/n/openssl-0.9.8n-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/a/infozip-6.0-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/d/gcc-g++-4.4.4-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/l/gtk+-1.2.10-i486-5.txz
http://slackware.osuosl.org/slackware-13.1/slackware/l/gtk+2-2.18.9-i486-1.txz
http://slackware.osuosl.org/slackware-13.1/slackware/d/cmake-2.8.1-i486-1.txz

 

Install the packages:

installpkg *.t*z

 

Unzip the downloaded unRAID package:

unzip unRAID* -d /mnt/cache/.unraiddev

 

Go to "/usr/src" directory and rename the folder "linux-3.4.11-unRAID" to "linux-3.4.11-unRAID_original".

mv /usr/src/linux-3.4.11-unRAID /usr/src/linux-3.4.11-unRAID_original

 

Extract the vanilla kernel file (linux-3.4.11.tar.gz) into "/usr/src":

tar -C /usr/src/ -zxvf linux-3.4.11.tar.gz

 

Link the new source directory (linux-3.4.11) to the "linux-3.4.11-unRAID" path:

ln -sf /usr/src/linux-3.4.11 /usr/src/linux-3.4.11-unRAID

 

Copy all default drivers and configuration to the new source directory:

cp -rf /usr/src/linux-3.4.11-unRAID_original/* /usr/src/linux-3.4.11/
cp -f /usr/src/linux-3.4.11-unRAID_original/.config /usr/src/linux-3.4.11/

 

Link kernel headers includes to the new source includes:

ln -sf /usr/src/linux-3.4.11-unRAID/include/asm-generic /usr/include/asm-generic
ln -sf /usr/src/linux-3.4.11-unRAID/include/linux /usr/include/linux
ln -sf /usr/src/linux-3.4.11-unRAID/arch/x86/include/asm /usr/include/asm

 

Configure the kernel:

cd /usr/src/linux-3.4.11-unRAID/
make clean
make menuconfig

 

You're in the kernel configuration utility. Scroll down and select (press enter):

Device Drivers --->

 

Now go down to:

Multimedia Support --->

and press an 'M' on it to compile it as a module. After that, go into Multimedia support (press enter), then configure

Video for Linux --->

to be compiled as a module as well by pressing 'M' on it.

 

Following that you have to enable the support for your tuner card. Press 'M' on:

DVB for Linux

 

You may also need to dig into and configure the appropriate Video Encoders according to what is on your card:

Video Capture Adapters

 

Once configured everything select 'EXIT' until you see a question: 'Do you wish to save your new kernel configuration?'. Select yes here.

make bzImage
make modules
make modules_install

 

Copy the created bzImage to the boot directory:

cp arch/x86/boot/bzImage /boot/bzimage_new

 

 

Find and download the Realtek r8168 driver from their website and place it in the .unraiddev dir (it has to be installed manually otherwise unRAID will boot without network access).

 

Extract, build and install:

cd /mnt/cache/.unraiddev/
tar -xjf r8168*.tar.bz2
cd /mnt/cache/.unraiddev/r8168-8.032.00
make modules
make install

 

 

Download the latest dvbhdhomerun, place it in the development dir, and extract, build and install*:

cd /mnt/cache/.unraiddev
tar -xjf dvbhdhomerun*.tar.gz (not sure about the arguments)
cd /mnt/cache/.unraiddev/dvbhdhomerun-0.0.11/kernel
make clean
make
make install

 

Download and build libhdhomerun*:

cd /mnt/cache/.unraiddev
wget http://download.silicondust.com/hdhomerun/libhdhomerun_20120405.tgz
tar -xjf libhdhomerun*.tgz (not sure about the arguments)	
cd /mnt/cache/.unraiddev/libhdhomerun
make clean
make

 

Configure userhdhomerun:

Open /mnt/cache/.unraiddev/dvbhdhomerun-0.0.11/userhdhomerun/CMakelists.txt and change the LIBHDHOMERUN_PATH to the libhdhomerun directory you just untar'ed (/mnt/cache/.unraiddev/libhdhomerun).

cd /mnt/cache/.unraiddev/dvbhdhomerun-0.0.11/userhdhomerun
make

 

 

Create a temporary directory and extract the vanilla unRAID bzroot into it:

mkdir /mnt/cache/.unraiddev/bz-mod
cd /mnt/cache/.unraiddev/bz-mod
xzcat ../bzroot | cpio -i -d -H newc --no-absolute-filenames

 

Syncronize (overwrite) the extracted vanilla modules with the newly compiled modules and copy the userhdhomerun file*:

rsync -av --delete /lib/modules/3.4.11-unRAID/ /mnt/cache/.unraiddev/temp/bz-mod/lib/modules/3.4.11-unRAID/
cp /usr/bin/userhdhomerun /mnt/cache/.unraiddev/temp/bz-mod/usr/bin/ (I think some arguments are missing here)

 

package the new bzroot:

cd /mnt/cache/.unraiddev/bz-mod/
find . | cpio -o -H newc | xz --format=lzma > /boot/bzroot_new

 

Rename the _new files in /boot, restart the server and unRAID should be running with the r8168 and HDHomerun enabled.

 

I have also added this to my go file, although I'm not sure the Realtek part is actually necessary:

# Load Realtek r8168 driver
cd /lib/modules/3.4.11-unRAID/kernel/drivers/net/ethernet/realtek
depmod -a
insmod r8168.ko

# Start HDHomeRun
#! /bin/sh
cd /lib/modules/3.4.11-unRAID/extra/
modprobe dvb_hdhomerun
sleep 3
/usr/bin/userhdhomerun &

 

Furthermore, the TVHeadend config file won't persist after a reboot, so I've created it on my flash drive and then symlink it in the go file (TVHeadend recognizes my HDHomerun Dual as a DVB-T tuner if this file isn't set up):

# Symlink Tvheadend config file
ln -s /boot/custom/tvheadend/dvbhdhomerun /etc/dvbhdhomerun

 

Link to comment
  • 1 month later...

Pinch,

 

Thanks for the great write up.  I was able to skip the build/compile Kernel aspects since Botez posted a copy of his custom bzroot and bzimage for rc8a in the other thread.

 

Have you been able to setup the rest of TVHeadend properly?  EPG and what not?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.