SageTV Community  

Go Back   SageTV Community > Information & Announcements > SageTV Downloads & Instructions

Notices

SageTV Downloads & Instructions This forum is for discussions containing Downloads and Instructions related to the Open Source version of SageTV. Please do not post questions in this forum.

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-23-2016, 09:52 PM
SageWizdom SageWizdom is offline
Sage Advanced User
 
Join Date: Oct 2013
Location: https://github.com/SageWizdom/SageConnect
Posts: 216
Basic Linux V9 Build and Walkthrough - V2

Seeing all the great work on Sage v9, I wanted to try and document a basic Linux install and setup. This is Version 2. It is still a work in progress (automation hopefully next). I will continue to make edits and updates to this post. Suggestions, fixes, ideas are welcome and appreciated. Thanks!

NOTE: This will install a command line only server (No GUI). This is based on Ubuntu Server 14.04.3 LTS - 64 bit. The SageTV GUI can be easily managed and configured via a client on another machine once this install is complete. I have attempted to share and document standard linux command line calls in this and the below walkthroughs. My test server boots in about 20 seconds and has very few extra processes running, dedicating as much ram/processor time to Sage and any transcoding tasks.

Note: A posting about basic linux commands is available here (here)

1) Backup your current install
Backup anything you want to save on your computer (insert link to the upgrade sage thread). This is typically your entire sagetv directory, your media directory and any custom configurations (ir remote install, primenet encoder, sagedct, etc).

2) Install Linux
See the post below for how (http://forums.sagetv.com/forums/show...92&postcount=2)


After installing Linux:
** the remainder of this walkthough is being replaced by an automated install script for both Sage and encoders available here (http://forums.sagetv.com/forums/showthread.php?p=585773)

To install Manually, continue with the below instructions:

3) Check for and install updates
Log in as the user you created during installation and with the configured password. Run the below commands.

Code:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot
You will be asked to type in your password to validate your sudo privileges.

To explain the commands:
sudo or "superuser do" executes the following command as a super user. You must have sudo privileges to do this. by default the user created during install will have sudo privileges.

apt-get is the ubuntu package manager. This command allows you to install, manage or remove linux software packages in linux. In this command, we are using the install keyword to install several packages. apt-get will automatically identify and install any missing dependancies for the software you ask it to install. It will also validate with you, after it has figured out what it needs to do, but before it installs anything.

sudo apt-get update will update the internal database to find out what software is available and what needs to be updated.

sudo apt-get upgrade will update all of the software already on your computer / already installed

sudo apt-get dist-upgrade will install any needed updates / security patches that your computer needs.

Once complete, reboot the system to ensure all changes take effect.


4) Check your network settings
By default, the install will use DHCP. This should be fine for most/all dealings in the system. If you would like to configure a static ip, see the original walkthrough for details. I use a static IP for two reasons: A) it makes it easier to SSH into my system knowing where it is and B) this makes access to the mobile web interface easier. If your Sage box has a DNS name... none of this may matter (let me know in the comments if you all want me to put the static ip config back in this document)

To find your current IP address type:
Code:
>> ifconfig

eth0      Link encap:Ethernet  HWaddr 12:ad:6c:25:30:c1  
          inet addr:192.168.0.187  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:169 errors:0 dropped:18 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:30311 (30.3 KB)  TX bytes:8517 (8.5 KB)
This will display all the network connections on your computer. Your connection should be labeled as eth0. eth for ethernet, 0 as this is your first ethernet card. If you have multiple ethernet connections you will have multiple entries. There will also be one labeled "lo" for loop back.


5) Install Java
Following directions from the Linux SageTV thread, install Java
http://forums.sagetv.com/forums/showthread.php?t=62324

Open a terminal
Select "Activities" -> "Show Applications" -> "Byobu Terminal"

Code:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install -y oracle-java8-installer
The first command adds the java repository to your computer so that apt-get knows how to get files from it.

Add Java Environment Variables
Installing Java does not appear to add the needed environment variables. This will add them to your ".bashrc" file. The ".bashrc" file is automatically run every time you create a new bash shell (it is your default login shell). If you use currently or choose to use a different logon shell, you should add these commands to a startup script for that shell.

Code:
echo "" >> .bashrc
echo "export JDK_HOME=/usr/lib/jvm/java-8-oracle/" >> .bashrc
echo "export JAVA_ARCH=amd64" >> .bashrc
echo "" >> .bashrc

6) Install Sage Dependancies
Install ubuntu SageTV Dependancies
(From the linux build thread http://forums.sagetv.com/forums/showthread.php?t=62324)

This is one very long line, make sure to copy the whole thing.

Code:
sudo apt-get install libx11-dev libxt-dev libraw1394-dev libavc1394-dev libiec61883-dev libfreetype6-dev yasm autoconf libtool build-essential libaudio-dev libpulse-dev libasound-dev madplay libasound2 xorg libfaad-dev
Reboot again to make sure all the libraries load appropriately
Code:
sudo reboot

7) Install Sage

This install uses the .deb package created by stuckless (awesome!)

Download the SageTV .deb package by running the below command.
http://forums.sagetv.com/forums/showthread.php?t=62422
NOTE: The below link is correct as of 23Feb2016. If a new version has come out, simply check the above thread for the latest download.

Download SageTV 9 JAR
Code:
# Download the SageTV .deb package
> wget https://bintray.com/artifact/download/opensagetv/sagetv/sagetv/9.0.4.232/sagetv-server_9.0.4_amd64.deb

# Install the package to /opt/sagetv/server/
> sudo dpkg -i sagetv-server_9.0.4_amd64.deb
Note1: It will ask for your sage license key as part of this. If you have it handy, put it in now to get access to the tv listing server. If you do not, skip this step and you can enter it later

Note2: The .deb currently launches the SageTV executable as part of the install... because this takes over the foreground terminal, you will need to use the ctrl-c (break) combination to stop it. We will reboot in a few minutes after which Sage will automatically launch in the background at boot time.

Note3: As new versions become available, you can re-download the .deb and re-install it to get the latest updates... Make sure to backup your database before hand (TODO: Document this / or better yet, automate this)

8) Use an existing SageTV Key for guide updates
If you have a valid Window or Linux SageTV license key, and did not enter it in the previous step.
Create a file named "activkey" in the sagetv folder (/opt/sagetv/server/) containing your key
(from the following thread http://forums.sagetv.com/forums/show...406#post577406)

Code:
echo "your key" > activkey
for example (but not a valid key) (32 characters letters and numbers)

Code:
echo "DF68I5XXXXXXXXXXXXXXXXXXXXXXXXXX" > activkey

9) Open network ports
By default the system does not have a firewall enabled. If you do nothing, it should stay this way. If you would like to enable a firewall...

To allow the client to talk to the server, you need to open ports on the server. Ubuntu is using the ufw to control the iptables firewall. Once complete, you will need to restart to ensure all changes have taken.

NOTE you MUST edit the first 3 octets below to match you home network subnet.
Code:
sudo ufw allow proto tcp from 192.168.0.0/24 to any port 22
sudo ufw allow proto tcp from 192.168.0.0/24 to any port 7760
sudo ufw allow proto tcp from 192.168.0.0/24 to any port 7818
sudo ufw allow proto tcp from 192.168.0.0/24 to any port 8018
sudo ufw allow proto tcp from 192.168.0.0/24 to any port 8080
sudo ufw allow proto udp from 192.168.0.0/24 to any port 8271
sudo ufw allow proto tcp from 192.168.0.0/24 to any port 31099
sudo ufw allow proto udp from 192.168.0.0/24 to any port 31100
sudo ufw allow proto tcp from 192.168.0.0/24 to any port 42024

sudo iptables -I INPUT -p udp -m udp --sport 65001 -j ACCEPT

sudo reboot
The last command should allow the "hdhomerun_config discover" command to work by accepting packets on the correct source port (thanks Boolah)

10) Configure Sage
Once your system has rebooted, point a Sage Client or Placeshifter at the server and you should be able to configure it.

Walkthroughs of Network Encoder Installs are below

HDHomeRun Prime with PrimeNetEncoder
http://forums.sagetv.com/forums/show...267#post581267

HDHomeRun Prime with OpenDCT
http://forums.sagetv.com/forums/show...21&postcount=1


Bonus) Adding Another HD
** Clean up the below when I'm actually awake**
Note the below is draft thoughts and comments
Given the low price of storage, here is how to add more.
A) Install another hard drive

B) Find it on your system.
- run "parted" to find your attached storage devices
-- Run Parted "sudo parted"
-- List attached devices "(parted) print devices"... find your device name based on size (ex. /dev/sdb)
-- Select the device you want to work with "select /dev/sdb"
-- Create a partition table "mklabel gpt" This specifically makes a guid based partition table (good for larger TB sized drives)
-- exit and save

use gdisk to create a partition
"sudo gdisk" ("sudo apt-get install gdisk" if needed)
create a new partition by typing "n"
if you want to use the whole drive, just use the defaults (keep hitting enter)
once back to the main command input, type "w" to write to disk (select Y if you are sure)

Format your partition
"sudo mkfs -t ext4 /dev/sdb1"
This makes a couple assumptions. This assumes you want an ext4 filesystem (vs fat32 or similar). This also assumes your drive is located at the above example. Replace this with the real path to your disk.

auto mount your drive
"sudo nano /etc/fstab"
create a new line at the bottom to tell you computer to auto mount the drive at boot. It should look like:
"/dev/sdb1 /mnt/storage ext4 errors=remount-ro 0 2"

create the mount point
"sudo mkdir /mnt/storage"

mount the drive
"sudo mount /dev/sdb1"

You should now be able to access the drive "cd /mnt/storage"
next add directories and configure sage to use this storage space.

Last edited by SageWizdom; 03-05-2016 at 07:07 PM.
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Build SageTV (Linux Specific) + GitHub primer stuckless SageTV Github Development 81 09-04-2016 12:27 PM
XenServer hypervisor build walkthrough SageWizdom SageTV Downloads & Instructions 18 07-10-2016 08:15 PM
Basic Linux V9 Build and Walkthrough - First Draft SageWizdom SageTV Downloads & Instructions 32 02-20-2016 09:29 PM
Basic Linux Commands and Usage SageWizdom SageTV Downloads & Instructions 0 11-27-2015 08:39 PM
New SageTV Client Build basic question AWS Hardware Support 2 02-08-2005 08:03 PM


All times are GMT -6. The time now is 04:31 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.