Tuesday, December 12, 2006

MythTV on openSUSE 10.2

OK, it's been a while, but here it is. This time, due to popular demand at work, here's a script that should install MythTV from a (KDE) default openSUSE 10.2 install.

The script will need to be run as root. If you wish to enable encoded DVD support, you'll need to uncomment a few lines in the script. Please, only do this if you know it's legal where you are. If you're not sure, I'd suggest you don't.

Please leave a comment and let me know if you uncover any issues with this and I'll adjust it as quickly as possible.

#!/bin/sh
mkdir /tmp/inst_myth
cd /tmp/inst_myth

#Install SMART
echo Installing SMART Package Manager
yast -i smart smart-gui

#Install DVD support
#If it is legal for you to enable DVD support where you are you need to uncomment the following three lines
#Do not do this if it is not legal, I hold no responibility if you do.
#echo installing DVD support
#/usr/bin/wget http://download.videolan.org/pub/libdvdcss/1.2.9/rpm/libdvdcss2-1.2.9-1.i386.rpm
#rpm -Uvh libdvdcss2-1.2.9-1.i386.rpm

#Prepare SMART Channels
#Delete any you don't want...
echo Preparing SMART Channels
mkdir /etc/smart/channels

#Creating /etc/smart/channels/beryl.channel
echo [beryl]>/etc/smart/channels/beryl.channel
echo # key import>>/etc/smart/channels/beryl.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/beryl.channel
echo name = beryl repository>>/etc/smart/channels/beryl.channel
echo baseurl = http://software.opensuse.org/download/X11:/XGL/openSUSE_10.2/ >>/etc/smart/channels/beryl.channel
echo type = rpm-md>>/etc/smart/channels/beryl.channel

#Creating /etc/smart/channels/guru.channel
echo [guru]>/etc/smart/channels/guru.channel
echo # key import>>/etc/smart/channels/guru.channel
echo # rpm --import http://linux01.gwdg.de/~pbleser/guru-rpm.asc>>/etc/smart/channels/guru.channel
echo name = Guru 3rd party package repository>>/etc/smart/channels/guru.channel
echo baseurl = http://ftp.gwdg.de/pub/linux/misc/suser-guru/rpm/10.2>>/etc/smart/channels/guru.channel
echo type = yast2>>/etc/smart/channels/guru.channel
echo mirror = http://ftp.skynet.be/pub/suser-guru/rpm/10.2>>/etc/smart/channels/guru.channel

#Creating /etc/smart/channels/guru-kde35.channel
echo [guru-kde35]>/etc/smart/channels/guru-kde35.channel
echo # key import>>/etc/smart/channels/guru-kde35.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/guru-kde35.channel
echo name = gurus kde 3.5 repository>>/etc/smart/channels/guru-kde35.channel
echo baseurl = http://ftp.gwdg.de/pub/linux/misc/suser-guru/kde35/>>/etc/smart/channels/guru-kde35.channel
echo type = rpm-md>>/etc/smart/channels/guru-kde35.channel

#Creating /etc/smart/channels/nvidia.channel
echo [nvidia]>/etc/smart/channels/nvidia.channel
echo # key import>>/etc/smart/channels/nvidia.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/nvidia.channel
echo name = nvidia repository>>/etc/smart/channels/nvidia.channel
echo baseurl = ftp://download.nvidia.com/opensuse/10.2/>>/etc/smart/channels/nvidia.channel
echo type = rpm-md >>/etc/smart/channels/nvidia.channel

#Creating /etc/smart/channels/opensuse-games-action.channel
echo [opensuse-games-action]>/etc/smart/channels/opensuse-games-action.channel
echo # key import>>/etc/smart/channels/opensuse-games-action.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/opensuse-games-action.channel
echo name = opensuse-games-action repository>>/etc/smart/channels/opensuse-games-action.channel
echo baseurl =http://software.opensuse.org/download/games:/action/openSUSE_10.2/>>/etc/smart/channels/opensuse-games-action.channel
echo type = rpm-md>>/etc/smart/channels/opensuse-games-action.channel

#Creating /etc/smart/channels/opensuse-games-adventure.channel
echo [opensuse-games-adventure]>/etc/smart/channels/opensuse-games-adventure.channel
echo # key import>>/etc/smart/channels/opensuse-games-adventure.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/opensuse-games-adventure.channel
echo name = opensuse-games-adventure repository>>/etc/smart/channels/opensuse-games-adventure.channel
echo baseurl = http://software.opensuse.org/download/games:/adventure/openSUSE_10.2/>>/etc/smart/channels/opensuse-games-adventure.channel
echo type =
rpm-md>>/etc/smart/channels/opensuse-games-adventure.channel
echo >>/etc/smart/channels/opensuse-games-adventure.channel

#Creating /etc/smart/channels/opensuse-games-board.channel
echo [opensuse-games-board]>/etc/smart/channels/opensuse-games-board.channel
echo # key import>>/etc/smart/channels/opensuse-games-board.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/opensuse-games-board.channel
echo name = opensuse-games-board repository>>/etc/smart/channels/opensuse-games-board.channel
echo baseurl = http://software.opensuse.org/download/games:/board/openSUSE_10.2/>>/etc/smart/channels/opensuse-games-board.channel
echo type =
rpm-md>>/etc/smart/channels/opensuse-games-board.channel

#Creating /etc/smart/channels/opensuse-games-data.channel
echo [opensuse-games-data]>/etc/smart/channels/opensuse-games-data.channel
echo # key import>>/etc/smart/channels/opensuse-games-data.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/opensuse-games-data.channel
echo name = opensuse-games-data repository>>/etc/smart/channels/opensuse-games-data.channel
echo baseurl = http://software.opensuse.org/download/games:/data/Generic/>>/etc/smart/channels/opensuse-games-data.channel
echo type =
rpm-md>>/etc/smart/channels/opensuse-games-data.channel

#Creating /etc/smart/channels/opensuse-games-puzzle.channel
echo [opensuse-games-puzzle]>/etc/smart/channels/opensuse-games-puzzle.channel
echo # key import>>/etc/smart/channels/opensuse-games-puzzle.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/opensuse-games-puzzle.channel
echo name = opensuse-games-puzzle repository>>/etc/smart/channels/opensuse-games-puzzle.channel
echo baseurl = http://software.opensuse.org/download/games:/puzzle/openSUSE_10.2/>>/etc/smart/channels/opensuse-games-puzzle.channel
echo type =
rpm-md>>/etc/smart/channels/opensuse-games-puzzle.channel
echo mirror = >>/etc/smart/channels/opensuse-games-puzzle.channel

#Creating /etc/smart/channels/opensuse-games-roleplay.channel
echo [opensuse-games-roleplay]>/etc/smart/channels/opensuse-games-roleplay.channel
echo # key import>>/etc/smart/channels/opensuse-games-roleplay.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/opensuse-games-roleplay.channel
echo name = opensuse-games-roleplay repository>>/etc/smart/channels/opensuse-games-roleplay.channel
echo baseurl = http://software.opensuse.org/download/games:/roleplay/openSUSE_10.2/>>/etc/smart/channels/opensuse-games-roleplay.channel
echo type =
rpm-md>>/etc/smart/channels/opensuse-games-roleplay.channel

#Creating /etc/smart/channels/opensuse-games-strategy-realtime.channel
echo [opensuse-games-stragegy-realtime]>/etc/smart/channels/opensuse-games-strategy-realtime.channel
echo # key import>>/etc/smart/channels/opensuse-games-strategy-realtime.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/opensuse-games-strategy-realtime.channel
echo name = opensuse-games-stragegy-realtime repository>>/etc/smart/channels/opensuse-games-strategy-realtime.channel
echo baseurl = http://software.opensuse.org/download/games:/strategy:/turn-based/openSUSE_10.2/>>/etc/smart/channels/opensuse-games-strategy-realtime.channel
echo type =
rpm-md>>/etc/smart/channels/opensuse-games-strategy-realtime.channel

#Creating /etc/smart/channels/opensuse-games-strategy-turnbased.channel
echo [opensuse-games-stragegy-turnbased]>/etc/smart/channels/opensuse-games-strategy-turnbased.channel
echo # key import>>/etc/smart/channels/opensuse-games-strategy-turnbased.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/opensuse-games-strategy-turnbased.channel
echo name = opensuse-games-stragegy-turnbased repository>>/etc/smart/channels/opensuse-games-strategy-turnbased.channel
echo baseurl = http://software.opensuse.org/download/games:/strategy:/realtime/openSUSE_10.2/>>/etc/smart/channels/opensuse-games-strategy-turnbased.channel
echo type =
rpm-md>>/etc/smart/channels/opensuse-games-strategy-turnbased.channel

#Creating /etc/smart/channels/opensuse-non-oss.channel
echo [opensuse-non-oss]>/etc/smart/channels/opensuse-non-oss.channel
echo name = OpenSuSE Non-OSS repository>>/etc/smart/channels/opensuse-non-oss.channel
echo baseurl = http://download.opensuse.org/distribution/10.2/repo/non-oss/>>/etc/smart/channels/opensuse-non-oss.channel
echo type = yast2>>/etc/smart/channels/opensuse-non-oss.channel

#Creating /etc/smart/channels/opensuse-oss.channel
echo [opensuse-oss]>/etc/smart/channels/opensuse-oss.channel
echo name = OpenSuSE OSS repository>>/etc/smart/channels/opensuse-oss.channel
echo baseurl = http://download.opensuse.org/distribution/10.2/repo/oss/>>/etc/smart/channels/opensuse-oss.channel
echo type = yast2>>/etc/smart/channels/opensuse-oss.channel

#Creating /etc/smart/channels/packman.channel
echo [packman]>/etc/smart/channels/packman.channel
echo #key import>>/etc/smart/channels/packman.channel
echo #rpm --import http://packman.unixheads.com/suse/10.2/gpg-pubkey-1abd1afb.asc>>/etc/smart/channels/packman.channel
echo name = Packman 3rd Party Package Repository>>/etc/smart/channels/packman.channel
echo baseurl = http://mirror.pacific.net.au/linux/packman/suse/10.2/>>/etc/smart/channels/packman.channel
echo type = rpm-md>>/etc/smart/channels/packman.channel
echo mirror = http://packman.iu-bremen.de/suse/10.2>>/etc/smart/channels/packman.channel
echo mirror = http://packman.mirrors.skynet.be/pub/packman/suse/10.2/>>/etc/smart/channels/packman.channel
echo mirror = http://mirror.geht-schon.de/packman.links2linux.de/suse/10.2/>>/etc/smart/channels/packman.channel
echo mirror = http://ftp.uni-erlangen.de/pub/mirrors/packman/suse/10.2/>>/etc/smart/channels/packman.channel
echo mirror = http://ftp.halifax.rwth-aachen.de/packman/suse/10.2/>>/etc/smart/channels/packman.channel
echo mirror = http://ftp.gwdg.de/pub/linux/misc/packman/suse/10.2/>>/etc/smart/channels/packman.channel
echo mirror = http://ftp.gts.lug.ro/packman/suse/10.2/>>/etc/smart/channels/packman.channel
echo mirror = http://packman.unixheads.com/suse/10.2/>>/etc/smart/channels/packman.channel
echo mirror = http://packman.sharewarestorage.com/archive/suse/10.2/>>/etc/smart/channels/packman.channel
echo >>/etc/smart/channels/packman.channel

#Creating /etc/smart/channels/schiele.channel
echo [schiele]>/etc/smart/channels/schiele.channel
echo # key import>>/etc/smart/channels/schiele.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/schiele.channel
echo name = schiele repository>>/etc/smart/channels/schiele.channel
echo baseurl = http://pi3.informatik.uni-mannheim.de/~schiele/suse/10.2>>/etc/smart/channels/schiele.channel
echo type = rpm-md>>/etc/smart/channels/schiele.channel

#Creating /etc/smart/channels/suser-jengelh.channel
echo [suser-jengelh]>/etc/smart/channels/suser-jengelh.channel
echo # key import>>/etc/smart/channels/suser-jengelh.channel
echo # rpm --import INSERT URL HERE>>/etc/smart/channels/suser-jengelh.channel
echo name = suser-jengelh repository>>/etc/smart/channels/suser-jengelh.channel
echo baseurl = http://ftp.gwdg.de/pub/linux/misc/suser-guru/rpm/10.2>>/etc/smart/channels/suser-jengelh.channel
echo type = rpm-md>>/etc/smart/channels/suser-jengelh.channel

#Run the SMART update to get file information
echo Updating SMART package listings
smart update

#Install Myth Packages (without development and mytharchive due to dependency issue)
echo Installing MythTV/MySQL/Apache2
echo You will be asked to confirm the packages listings,
echo You may also be asked to confirm GPG keys, if you\'re a trusting kind of person, choose yes to all of these...
export MYTH_PACKAGES=`smart search myth*|awk '{ print $1 }'|grep -i myth|grep -v devel|grep -v archive`
smart install $MYTH_PACKAGES mysql apache2

#Prepare MySQL for starting on boot
echo Preparing MySQL
/sbin/chkconfig mysql on

/etc/init.d/mysql start

echo Please enter a new MySQL root password
echo This is a new password, you can use the same password as your root account
echo However, this is not recommended for security reasons
echo Please note that the password will not be displayed on the terminal
echo ""
read -sp "Enter new password: " MYSQLROOTPWD
/usr/bin/mysqladmin -u root password $MYSQLROOTPWD
/usr/bin/mysqladmin -u root -h `cat /etc/HOSTNAME` password $MYSQLROOTPWD

echo ""
echo Creating MythTV database
echo Please enter the MySQL root password you\'ve just created when prompted

/usr/bin/mysql -u root -p <`rpm -ql mythtv|grep -i sql`

#Creating MythTV storage directories
#UID 1000 is used as this is the first user created on the openSUSE system, normally it's appropriate
mkdir -p /opt/mythtv/{recordings,music,pictures,games,posters,dvd,temp,video}
sudo chown -R 1000:users /opt/mythtv
sudo chmod g+ws /opt/mythtv
sudo chmod g+ws /opt/mythtv/

#Running MythTV Setup
/usr/bin/mythtvsetup


Labels: ,

3 Comments:

Blogger Hiney said...

Way kewl Zenophran. Seems to work fine so far.

11:43 am  
Blogger Hiney said...

"echo /usr/bin/mysqladmin -u root password $MYSQLROOTPWD
echo /usr/bin/mysqladmin -u root -h `cat /etc/HOSTNAME` password $MYSQLROOTPWD"

need the echo moved from both lines.

1:40 pm  
Blogger Zenophran said...

Thanks Peter. They've been fixed...

2:10 pm  

Post a Comment

<< Home