#!/bin/bash # # "amicus" - automatic multimedia configuration / installation utility system # # http://amicus.sourceforge.net # # http://sourceforge.net/projects/amicus # # by Andrew Lynch # a n d r e w - l y n c h . a t . s b c g l o b a l . d o t . n e t # # version 0.01 # started 25 Jan 2006 # initial prototype framework # proof of concept development only # Initial Release 10 Feb 2006 # changelog # - added basic Debian MythTV install steps 1-5 # - added bttv support # - added NVidia video card support # - added various MythTV related utilities # - added LIRC ATI Remote Wonder # - began prototype work on ivtv, LIRC # - began compile MythTV from source option # - began support for MythTV plugins # # version 0.02 # started 11 Feb 2006 # feature expansion # changelog # - added automatic clock synchronization # - added automatic mythtv frontend on boot # - fixed compile mythtv from source option # - added compile XViD/x264/MPlayer from source option # - added MythTV 0.19 package sources # - added configure frontend only option # # version 0.03 # started 18 Feb 2006 # bug fixes and changes to support MythTV 0.19 release # - All MythTV plugins work except MythBrowser # - Mythtv 0.19 tweaks # - added pre-load apt cache feature # - added install from CD ISO reset password & config option # - fixed step 5 endless loop bug # - added feedback on completed steps in install/config # - added date/time stamps to debug log per run # - fixed ivtv (Hauppauge PVR-x50) tuner support # - posted pre-release version of CD ISO image # - made ivtv able to configure before MythTV install # - made script code more modular # - added "all in one" install MythTV option # - added ivtv configure for more than one card # - added improved configure of X and ALSA # - started automatic tuner detection and configure # check_errs() { # ref: http://steve-parker.org/sh/exitcodes.shtml # function. Parameter 1 is the return code # Parameter 2 is text to display on failure if [ "${1}" -ne "0" ]; then echo "ERROR # ${1} : ${2}" # return with error code exit ${1} fi } insert_delimiter() { echo "########################################" >> $dir/$debug echo >> $dir/$debug echo $1 >> $dir/$debug echo >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } dump_debug_info() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start dump debug info and exit" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug echo "this utility dumps debug info to file for analysis" echo "A.M.I.C.U.S. system status dump file" >> $dir/$debug echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start dmesg" >> $dir/$debug dmesg >> $dir/$debug echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start lspci" >> $dir/$debug lspci >> $dir/$debug echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start lsmod" >> $dir/$debug lsmod >> $dir/$debug echo >> $dir/$debug insert_delimiter "ALSA Settings" cat /var/lib/alsa/asound.state >> $dir/$debug insert_delimiter "Xorg.conf" cat /etc/X11/xorg.conf >> $dir/$debug # clear echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end dump debug info and exit" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } mythtv_setup_utility() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start launch mythtv-setup" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug startx & >> $dir/$debug 2>&1 /etc/init.d/mythtv-backend stop >> $dir/$debug 2>&1 export DISPLAY=:0 >> $dir/$debug 2>&1 xhost + >> $dir/$debug 2>&1 su mythtv 'mythtv-setup' >> $dir/$debug 2>&1 killall Xorg >> $dir/$debug 2>&1 echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end launch mythtv-setup" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } mythfilldatabase_utility() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start run mythfilldatabase" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug mythfilldatabase >> $dir/$debug 2>&1 echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end run mythfilldatabase" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } mythtv_frontend_utility() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start launch MythTV frontend" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug startx & >> $dir/$debug 2>&1 export DISPLAY=:0 xhost + su mythtv 'mythfrontend' >> $dir/$debug 2>&1 xhost - >> $dir/$debug 2>&1 killall Xorg >> $dir/$debug 2>&1 sleep 10 echo echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end launch MythTV frontend" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } restart_mythtv_backend_utility() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start restart MythTV backend" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug /etc/init.d/mythtv-backend restart >> $dir/$debug 2>&1 echo >> $dir/$debug echo ######################################## >> $dir/$debug echo "end restart MythTV backend" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } stop_mythtv_backend_utility() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start stop MythTV backend" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug /etc/init.d/mythtv-backend stop >> $dir/$debug 2>&1 echo >> $dir/$debug echo ######################################## >> $dir/$debug echo "end stop MythTV backend" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } start_mythtv_backend_utility() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start launch MythTV backend" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug /etc/init.d/mythtv-backend start >> $dir/$debug 2>&1 echo >> $dir/$debug echo ######################################## >> $dir/$debug echo "end launch MythTV backend" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } install_AMICUS_utilities() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start install amicus utilities" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug echo "apt-get -y --force-yes install ftp weblint cvs tidy sysutils mozilla-firefox bluefish" >> $dir/$debug apt-get -y --force-yes install weblint ftp cvs tidy sysutils mozilla-firefox bluefish apt-get -y --force-yes install weblint ftp cvs tidy sysutils mozilla-firefox bluefish >> $dir/$debug echo >> $dir/$debug echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end install amicus utilities" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } remove_mythtv_plugins() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start Remove MythTV plugins" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug extra_option="1" echo "extra_option="$extra_option >> $dir/$debug 2>&1 while [ $extra_option != "x" ] do echo "Remove MythTV Plugins MENU" echo echo "1. MythBrowser" echo "2. MythDVD" echo "3. MythGallery" echo "4. MythGame" echo "5. MythMusic" echo "6. MythNews" echo "7. MythPhone" echo "8. MythVideo" echo "9. MythWeather" echo "a. MythWeb" echo echo "x. Exit, Return to Main Menu" echo echo -n "Please select an option: " read extra_option echo "extra_option="$extra_option >> $dir/$debug 2>&1 case $extra_option in 1) # Remove MythBrowser apt-get remove mythbrowser apt-get remove mythbrowser >> $dir/$debug ;; 2) # Remove MythDVD apt-get remove mythdvd apt-get remove mythdvd >> $dir/$debug ;; 3) # Remove MythGallery apt-get remove mythgallery apt-get remove mythgallery >> $dir/$debug ;; 4) # Remove MythGame apt-get remove mythgame apt-get remove mythgame >> $dir/$debug ;; 5) # Remove MythMusic apt-get remove mythmusic apt-get remove mythmusic >> $dir/$debug ;; 6) # Remove MythNews apt-get remove mythnews apt-get remove mythnews >> $dir/$debug ;; 7) # Remove MythPhone apt-get remove mythphone apt-get remove mythphone >> $dir/$debug ;; 8) # Remove MythVideo apt-get remove mythvideo apt-get remove mythvideo >> $dir/$debug ;; 9) # Remove MythWeather apt-get remove mythweather apt-get remove mythweather >> $dir/$debug ;; a) # Remove MythWeb apt-get remove mythweb apt-get remove mythweb >> $dir/$debug ;; x) # exit ;; *) # anything else echo echo "\"$extra_option\" is not a valid option." sleep 3 ;; esac done echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end remove MythTV plugins" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } install_mythtv_plugins() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start install MythTV plugins" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug apt-get update apt-get update >> $dir/$debug extra_option="1" echo "extra_option="$extra_option >> $dir/$debug 2>&1 while [ $extra_option != "x" ] do echo "Install MythTV Plugins MENU" echo echo "1. MythBrowser (Broken)" echo "2. MythDVD" echo "3. MythGallery" echo "4. MythGame" echo "5. MythMusic" echo "6. MythNews" echo "7. MythPhone" echo "8. MythVideo" echo "9. MythWeather" echo "a. MythWeb" echo echo "x. Exit, Return to Main Menu" echo echo -n "Please select an option: " read extra_option echo "extra_option="$extra_option >> $dir/$debug 2>&1 case $extra_option in 1) # install MythBrowser echo "MythBrowser Plugin is broken" echo "MythBrowser Plugin is broken" >> $dir/$debug apt-get -y --force-yes install mythbrowser apt-get -y --force-yes install mythbrowser >> $dir/$debug ;; 2) # install MythDVD apt-get -y --force-yes install mythdvd apt-get -y --force-yes install mythdvd >> $dir/$debug ;; 3) # install MythGallery apt-get -y --force-yes install mythgallery apt-get -y --force-yes install mythgallery >> $dir/$debug ;; 4) # install MythGame apt-get -y --force-yes install mythgame apt-get -y --force-yes install mythgame >> $dir/$debug ;; 5) # install MythMusic apt-get -y --force-yes install mythmusic apt-get -y --force-yes install mythmusic >> $dir/$debug ;; 6) # install MythNews apt-get -y --force-yes install mythnews apt-get -y --force-yes install mythnews >> $dir/$debug ;; 7) # install MythPhone apt-get -y --force-yes install mythphone apt-get -y --force-yes install mythphone >> $dir/$debug ;; 8) # install MythVideo apt-get -y --force-yes install mythvideo apt-get -y --force-yes install mythvideo >> $dir/$debug ;; 9) # install MythWeather apt-get -y --force-yes install mythweather apt-get -y --force-yes install mythweather >> $dir/$debug ;; a) # install MythWeb apt-get -y --force-yes install mythweb apt-get -y --force-yes install mythweb >> $dir/$debug ;; x) # exit ;; *) # anything else echo; echo "\"$extra_option\" is not a valid option." sleep 3 ;; esac done echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end install MythTV plugins" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug } configure_frontend_only() { # ref http://knoppmythwiki.org/index.php?page=FrontendOnlyInstall # You first need to stop the mythtv backend which is currently running, # at the root prompt enter: apt-get update apt-get -y --force-yes install portmap /etc/init.d/mythtv-backend stop >> $dir/$debug 2>&1 # You can also stop the mysql server, enter: /etc/init.d/mysql stop >> $dir/$debug 2>&1 # Switch to the directory /usr/share/mythtv and change the word # 'localhost' on the first line of the file to the name or IP # number of the backend system you plan on using. echo -n "enter the IP address of the backend " read IP_backend echo "IP address of backend is :"$IP_backend >> $dir/$debug 2>&1 cd /usr/share/mythtv >> $dir/$debug 2>&1 mv mysql.txt mysql.txt.bak >> $dir/$debug 2>&1 cat mysql.txt.bak | sed "s,localhost,`$IP_backend`," > mysql.txt # Once you're satisified your frontend is connecting to your backend, you # need to stop the mythtv-backend from starting at boot time on the remote # frontend machine. update-rc.d -f mythtv-backend remove >> $dir/$debug 2>&1 # You can also stop mysql from starting at boot: update-rc.d -f mysql remove >> $dir/$debug 2>&1 # To remove the mysql server, databases and logs (as root) enter: apt-get remove mysql-server rm -rf /var/lib/mysql/* >> $dir/$debug 2>&1 rmdir /var/lib/mysql >> $dir/$debug 2>&1 rm -rf /var/log/mysql/* >> $dir/$debug 2>&1 rmdir /var/log/mysql >> $dir/$debug 2>&1 # You can also remove xmltv: apt-get remove xmltv echo echo "be sure to configure your backend to export NFS /myth directory" echo "you have to configure frontend to use the remote backend database" echo "starting MythTV-Setup. Press enter to continue" read bogus startx & >> $dir/$debug 2>&1 /etc/init.d/mythtv-backend stop >> $dir/$debug 2>&1 export DISPLAY=:0 >> $dir/$debug 2>&1 xhost + >> $dir/$debug 2>&1 su mythtv 'mythtv-setup' >> $dir/$debug 2>&1 killall Xorg >> $dir/$debug 2>&1 # configure frontend only machine to mount the backend's /myth # via NFS # ref http://knoppmythwiki.org/index.php?page=NFSHowTo # remote backend's store of recordings will be located on frontend's # /mnt/myth directory -> configure the frontend to look for them there mkdir /mnt/myth >> $dir/$debug 2>&1 portmap >> $dir/$debug 2>&1 mount $IP_backend:/myth /mnt/myth >> $dir/$debug 2>&1 echo $IP_backend":/myth /mnt/myth nfs defaults,auto,noatime 0 0 " >> /etc/fstab step_j="done" } compile_mplayer_from_source() { # All experimental AMICUS script portions (like this one) are intended # to be run by the root user in the trace format "sh -x ./amicus" # begin MPlayer construction # MPlayer software requirements apt-get update >> $dir/$debug 2>&1 apt-get -y --force-yes install binutils gcc make libsdl1.2debian libjpeg62 libpng12-0 lame alsa apt-get -y --force-yes install zlib1g libogg0 libvorbis0a liblivemedia* libdirectfb-0.9-22 apt-get -y --force-yes install cdparanoia libfreetype6 libxmms* libsmbclient # apt-get -y install libbio2jack0 apt-get -y --force-yes install cvs subversion nasm # prepare to get MPlayer by CVS and move to /usr/src for download mkdir /usr/src/mplayer >> $dir/$debug 2>&1 cd /usr/src/mplayer >> $dir/$debug 2>&1 # Downloading MPlayer CVS # You can also get MPlayer via anonymous CVS. Issue the following commands # to get the latest sources: cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer login cvs -z3 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer co -P main >> $dir/$debug 2>&1 # FFmpeg libavcodec/libavutil/libavformat # CVS MPlayer is not fully functional without a copy of the libavcodec, # libavformat and libavutil libraries from FFmpeg. Get FFmpeg CVS via # cvs -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg login cvs -z3 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co -P ffmpeg >> $dir/$debug 2>&1 # In order to include libavcodec and libavutil in CVS updates, add the following # lines to main/CVS/Entries: echo "D/libavcodec////" >> /usr/src/mplayer/main/CVS/Entries echo "D/libavutil////" >> /usr/src/mplayer/main/CVS/Entries echo "D/libavformat////" >> /usr/src/mplayer/main/CVS/Entries mv /usr/src/mplayer/ffmpeg/libavcodec /usr/src/mplayer/main >> $dir/$debug 2>&1 mv /usr/src/mplayer/ffmpeg/libavformat /usr/src/mplayer/main >> $dir/$debug 2>&1 mv /usr/src/mplayer/ffmpeg/libavutil /usr/src/mplayer/main >> $dir/$debug 2>&1 cd /usr/src/mplayer >> $dir/$debug 2>&1 # grab the essential codecs if [ ! -e essential-20050412.tar.bz2 ]; then wget http://ftp5.mplayerhq.hu/mplayer/releases/codecs/essential-20050412.tar.bz2 >> $dir/$debug 2>&1 fi tar xjf essential-20050412.tar.bz2 # make sure directory exists. mkdir /usr/local/lib/codecs/ >> $dir/$debug 2>&1 mv essential-20050412/* /usr/local/lib/codecs/. >> $dir/$debug 2>&1 # install the Onscreen Fonts if [ ! -e font-arial-iso-8859-1.tar.bz2 ]; then wget http://ftp5.mplayerhq.hu/mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2 >> $dir/$debug 2>&1 fi tar xjf font-arial-iso-8859-1.tar.bz2 >> $dir/$debug 2>&1 # need to choose a specific font: mkdir /usr/local/share/mplayer >> $dir/$debug 2>&1 mkdir /usr/local/share/mplayer/font >> $dir/$debug 2>&1 cp font-arial-iso-8859-1/font-arial-24-iso-8859-1/* /usr/local/share/mplayer/font/. >> $dir/$debug 2>&1 # get xvid codec if [ ! -e xvidcore-1.1.0.tar.bz2 ]; then wget http://downloads.xvid.org/downloads/xvidcore-1.1.0.tar.bz2 >> $dir/$debug 2>&1 fi tar xjf xvidcore-1.1.0.tar.bz2 >> $dir/$debug 2>&1 cd xvidcore-1.1.0/build/generic >> $dir/$debug 2>&1 ./configure >> $dir/$debug 2>&1 make >> $dir/$debug 2>&1 make install >> $dir/$debug 2>&1 # get the x264 codec cd /usr/src >> $dir/$debug 2>&1 svn co svn://svn.videolan.org/x264/trunk x264 >> $dir/$debug 2>&1 cd x264 >> $dir/$debug 2>&1 ./configure >> $dir/$debug 2>&1 make >> $dir/$debug 2>&1 make install >> $dir/$debug 2>&1 # Then build MPlayer: cd /usr/src/mplayer/main ./configure --enable-gui >> $dir/$debug 2>&1 make >> $dir/$debug 2>&1 make install >> $dir/$debug 2>&1 step_g="done" } automatic_mythtv_on_boot() { echo >> $dir/$debug echo ######################################## >> $dir/$debug echo "start automatic MythTV Frontend on Boot" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug mv /etc/inittab /etc/inittab.bak cat /etc/inittab.bak | sed "s,1:2345:respawn:/sbin/getty 38400 tty1,1:2345:respawn:/sbin/getty -n -l /usr/local/sbin/autologinmythtv 38400 tty1," >/etc/inittab echo -e "int main() { \n execlp( \"login\", \"login\", \"-f\", \"mythtv\", 0); \n } " > autologinmythtv.c gcc -o autologinmythtv autologinmythtv.c >> $dir/$debug 2>&1 cp autologinmythtv /usr/local/sbin/ echo -e "if [ -z \"\$DISPLAY\" ] && [ \$(tty) == /dev/tty1 ]; then\n startx\nfi" >>/home/mythtv/.profile if ! [ -d /home/mythtv/.fluxbox ] then su mythtv "mkdir /home/mythtv/.fluxbox" fi echo "[startup] {mythfrontend}" >> /home/mythtv/.fluxbox/apps echo >> $dir/$debug echo ######################################## >> $dir/$debug echo "end automatic MythTV Frontend on Boot" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_f="done" } automatic_clock_synchronization() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start automatic clock synchronization" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug apt-get update >> $dir/$debug apt-get -y --force-yes install ntpdate >> $dir/$debug tempfile=temp.`date +'%s'` >> $dir/$debug crontab -l >$tempfile echo >>$tempfile echo "# Automatic clock synchronization feature of AMICUS" >>$tempfile echo "7 * * * * /usr/sbin/ntpdate north-america.pool.ntp.org >/dev/null 2>&1" >>$tempfile crontab $tempfile >> $dir/$debug crontab -l >> $dir/$debug crontab -l rm $tempfile >> $dir/$debug echo >> $dir/$debug echo ######################################## >> $dir/$debug echo "end automatic clock synchronization" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_e="done" } compile_mythtv_from_source() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start build MythTV from source" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug # echo "This step is in development. Press enter to advance script" # echo "Please run in debug mode with commands visible: sh -x ./amicus" apt-get -y --force-yes install subversion cd /usr/src >> $dir/$debug 2>&1 # svn co http://svn.mythtv.org/svn/branches/release-0-18-fixes/mythtv >> $dir/$debug 2>&1 cd mythtv >> $dir/$debug 2>&1 mkdir mythtv cd mythtv svn co http://svn.mythtv.org/svn/trunk/mythtv svn co http://svn.mythtv.org/svn/trunk/mythplugins svn co http://svn.mythtv.org/svn/trunk/myththemes # cd mythtv apt-get -y --force-yes install qt3-dev-tools libqt3-mt-dev libqt3-compat-headers apt-get -y --force-yes install libqt3-i18n imlib11 esound-clients orbit libc6-dev tk8.3 apt-get -y --force-yes install alsa-base alsa-utils alsa-oss udev g++ lib64stdc++6 apt-get -y --force-yes install xmltv libasound2-dev libdvdnav-dev libdvdnav4 kdelibs4-dev apt-get -y --force-yes install libcdparanoia0-dev libflac-dev flac libid3tag0-dev apt-get -y --force-yes install libgnome-dev libncurses5-dev liblame-dev apt-get -y --force-yes install libcdaudio0-dev liblame0 echo "current directory is "`pwd` echo "kernel_extra is "$kernel_extra cd mythtv ./configure --enable-dvb --dvb-path=/usr/src/linux-headers$kernel_extra/include --prefix=/usr >> $dir/$debug 2>&1 qmake mythtv.pro >> $dir/$debug 2>&1 make >> $dir/$debug 2>&1 make install >> $dir/$debug 2>&1 cd ../mythplugins >> $dir/$debug 2>&1 ./configure --enable-all >> $dir/$debug 2>&1 qmake mythplugins.pro >> $dir/$debug 2>&1 make >> $dir/$debug 2>&1 make install >> $dir/$debug 2>&1 cd ../myththemes >> $dir/$debug 2>&1 ./configure >> $dir/$debug 2>&1 qmake myththemes.pro >> $dir/$debug 2>&1 make >> $dir/$debug 2>&1 make install >> $dir/$debug 2>&1 cd $dir >> $dir/$debug 2>&1 echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end build MythTV from source" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_d="done" } compile_lirc() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start configure LIRC ATI Remote Wonder" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug # ref http://www.lirc.org/html/index.html # ref http://mysettopbox.tv/phpBB2/viewtopic.php?t=4609&highlight=lirc+howto cd $dir >> $dir/$debug 2>&1 if [ ! -e lirc-0.8.0.tar.gz ]; then wget http://fresh.t-systems-sfr.com/linux/src/lirc-0.8.0.tar.gz >> $dir/$debug 2>&1 fi tar xzf $dir/lirc-0.8.0.tar.gz >> $dir/$debug 2>&1 cd $dir/lirc-0.8.0 >> $dir/$debug 2>&1 ./setup.sh make >> $dir/$debug 2>&1 make install >> $dir/$debug 2>&1 cp contrib/lirc.debian /etc/init.d/lirc >> $dir/$debug 2>&1 update-rc.d lirc defaults 20 >> $dir/$debug 2>&1 chmod 666 /dev/lircd >> $dir/$debug 2>&1 echo "alias char-major-61 lirc_atiusb" >> /etc/modprobe.d/lirc cat /etc/modprobe.d/lirc >> $dir/$debug 2>&1 cp $dir/lirc-0.8.0/remotes/atiusb/lircd.conf.atiusb /etc/lircd.conf >> $dir/$debug 2>&1 cp $dir/lirc-0.8.0/contrib/lircmd.conf /etc/lircmd.conf >> $dir/$debug 2>&1 lircd >> $dir/$debug 2>&1 modprobe -r lirc_atiusb >> $dir/$debug 2>&1 modprobe lirc_atiusb >> $dir/$debug 2>&1 irw >> $dir/$debug 2>&1 cd $dir >> $dir/$debug 2>&1 mv $dir/lirc-0.8.0 /usr/src >> $dir/$debug 2>&1 echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end configure LIRC ATI Remote Wonder" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_9="done" } configure_ivtv() { # reference http://ivtvdriver.org/index.php/Howto:Debian # keep the above site for reference but the method below is the # old style of updating ivtv and firmware from the ivytv.tv Chris # Kennedy site and the 0.4.2 version from http://ivtvdriver.org echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start configure ivtv tuner card" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug apt-get update apt-get -y --force-yes install make unzip tar linux-headers$kernel_extra gcc libc-dev g++ echo "# put ivtv options here" >> /etc/modprobe.d/ivtv echo "alias char-major-81 videodev" >> /etc/modprobe.d/ivtv echo "the linux kernel has detected these ivtv cards" echo dmesg | grep "ivtv" | grep "detected" echo echo "The PCI bus reports the following ivtv devices" echo lspci | grep "Multimedia" | grep "iTVC16" lspci | grep "Multimedia" | grep "iTVC15" echo echo "your current ivtv module configuration is:" cat /etc/modprobe.d/ivtv echo ivtv_option="1" echo "ivtv_option="$ivtv_option >> $dir/$debug 2>&1 while [ $ivtv_option != "x" ] do echo echo "Configure ivtv Tuner Cards MENU" echo "if your ivtv tuner card does not appear in the menu, select x to exit" echo echo "1. Hauppauge PVR-150/250/350/500" echo echo "x. Exit, Return to Main Menu" echo echo echo -n "Please select an option: " read ivtv_option echo "ivtv_option="$ivtv_option >> $dir/$debug 2>&1 if [ $ivtv_option != "x" ] then echo "which ivtv device would you like to configure?" echo -n "0 for ivtv0, 1 for ivtv1, etc :" read ivtv_num echo "ivtv_num="$ivtv_num >> $dir/$debug 2>&1 alias_exists=`modprobe -c | grep "alias char-major-81-"$ivtv_num` empty="" if [ "`echo $alias_exists`" != "`echo $empty`" ] then echo "That device name already exists, overwriting" fi echo "ivtv_num="$ivtv_num >> $dir/$debug 2>&1 echo "alias char-major-81-"$ivtv_num" ivtv" >>/etc/modprobe.d/ivtv fi case $ivtv_option in 1) # configure Hauppauge PVR-150/250/350/500 echo "options ivtv " >> /etc/modprobe.d/ivtv ;; x) # exit ;; *) # anything else echo; echo "\"$ivtv_option\" is not a valid option." sleep 3 ;; esac done cd $dir >> $dir/$debug 2>&1 if [ ! -e ivtv-0.4.2.tar.gz ]; then wget http://dl.ivtvdriver.org/ivtv/archive/0.4.x/ivtv-0.4.2.tar.gz >> $dir/$debug 2>&1 fi tar zxf ivtv-0.4.2.tar.gz >> $dir/$debug 2>&1 cd $dir/ivtv-0.4.2 >> $dir/$debug 2>&1 make >> $dir/$debug 2>&1 make install >> $dir/$debug 2>&1 cd $dir/ivtv-0.4.2/driver >> $dir/$debug 2>&1 make >> $dir/$debug 2>&1 make install >> $dir/$debug 2>&1 cd ../utils >> $dir/$debug 2>&1 make >> $dir/$debug 2>&1 make install >> $dir/$debug 2>&1 echo "you still have to edit /etc/mythtv/modules/ivtv to set modules options" echo "reboot when finished!" # install firmware files here. From http://ivtvdriver.org/index.php/Howto:Firmware cd $dir >> $dir/$debug 2>&1 if [ ! -e pvr_2.0.24.23035.zip ]; then wget ftp://ftp.shspvr.com/download/wintv-pvr_150-500/inf/pvr_2.0.24.23035.zip >> $dir/$debug 2>&1 fi unzip -o pvr_2.0.24.23035.zip >> $dir/$debug 2>&1 # Now, copy the two firmware files that you just extracted into the appropriate # location, and name them appropriately. For ivtv 0.4.2 and earlier, this is cp HcwMakoA.ROM /usr/lib/hotplug/firmware/v4l-cx25840.fw >> $dir/$debug 2>&1 cp HcwFalcn.rom /usr/lib/hotplug/firmware/v4l-cx2341x-enc.fw >> $dir/$debug 2>&1 # Now, we need to install the MPEG decoder firmware. Download the recommended # version and use the ivtvfwextract.pl utility to extract the firmware ("unzip" # must be installed and found in your $PATH for this to work): if [ ! -e pvr_1.18.21.22254_inf.zip ]; then wget ftp://ftp.shspvr.com/download/wintv-pvr_250-350/inf/pvr_1.18.21.22254_inf.zip >> $dir/$debug 2>&1 fi $dir/ivtv-0.4.2/utils/ivtvfwextract.pl pvr_1.18.21.22254_inf.zip >> $dir/$debug 2>&1 # Finally, we need the mpeg-init firmware. This firmware comes as a part of the # ivtv tarball, and therefore you already have it. Simply cd to the directory # where you untarred the ivtv-0.4.x distribution, and do the following if you # are dealing with ivtv 0.4.2 or earlier: rm /lib/modules/ivtv-fw-enc.bin >> $dir/$debug 2>&1 mv /lib/modules/ivtv-fw-dec.bin /usr/lib/hotplug/firmware/v4l-cx2341x-dec.fw >> $dir/$debug 2>&1 cp $dir/ivtv-0.4.2/v4l-cx2341x-init.mpg /usr/lib/hotplug/firmware >> $dir/$debug 2>&1 cd $dir >> $dir/$debug 2>&1 mv $dir/ivtv-0.4.2 /usr/src >> $dir/$debug 2>&1 # At this point, you are done. You should have four appropriately named firmware # files installed in /usr/lib/hotplug/firmware (ivtv 0.4.2 or earlier) # For more information on the different firmware versions available see firmware versions. # http://ivtvdriver.org/index.php/Firmware_versions # Create the video devices: these may already have been created, mknod /dev/video0 c 81 0 >> $dir/$debug 2>&1 mknod /dev/video16 c 81 16 >> $dir/$debug 2>&1 mknod /dev/video32 c 81 32 >> $dir/$debug 2>&1 mknod /dev/video224 c 81 224 >> $dir/$debug 2>&1 # load the ivtv module depmod -a >> $dir/$debug 2>&1 modprobe -r ivtv >> $dir/$debug 2>&1 modprobe ivtv >> $dir/$debug 2>&1 echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end configure ivtv tuner card" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_8="done" } configure_nvidia() { # reference http://www.linuxquestions.org/linux/answers/Applications_GUI_Multimedia/HOWTO_Installing_nVidia_Grapics_Drivers_on_Debian_Etch echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start configure NVidia video cards" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug if [ ! -e NVIDIA-Linux-x86-1.0-8178-pkg1.run ]; then wget http://download.nvidia.com/XFree86/Linux-x86/1.0-8178/NVIDIA-Linux-x86-1.0-8178-pkg1.run >> $dir/$debug 2>&1 fi chmod 766 NVIDIA-Linux-x86-1.0-8178-pkg1.run >> $dir/$debug sh NVIDIA-Linux-x86-1.0-8178-pkg1.run dpkg-reconfigure xserver-xorg echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end configure NVidia video cards" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_7="done" } configure_bt8x8() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start configure BT8x8 Cards" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug # clear echo "the linux kernel has detected these BT8x8 cards" echo dmesg | grep "bttv" | grep "detected:" echo echo "The PCI bus reports the following BT8x8 devices" echo lspci | grep "Multimedia" | grep "Bt878 Video" lspci | grep "Multimedia" | grep "Bt848 Video" echo echo "your current bttv module configuration is:" cat /etc/modprobe.d/bttv bt878_option="1" echo "bt878_option="$bt878_option >> $dir/$debug 2>&1 while [ $bt878_option != "x" ] do echo echo "Configure Specific BT8x8 Tuner Cards MENU" echo echo "1. Generic BT8x8 Tuner" echo "2. ATI TV Wonder VE" echo echo "x. Exit, Return to Main Menu" echo echo echo -n "Please select an option: " read bt878_option echo "bt878_option="$bt878_option >> $dir/$debug 2>&1 if [ $bt878_option != "x" ] then echo "which BT8x8 device would you like to configure?" echo -n "0 for bttv0, 1 for bttv1, etc :" read bttv_num echo "bttv_num="$bttv_num >> $dir/$debug 2>&1 alias_exists=`modprobe -c | grep "alias char-major-81-"$bttv_num` empty="" if [ "`echo $alias_exists`" != "`echo $empty`" ] then echo "That device name already exists, overwriting" fi echo "alias char-major-81-"$bttv_num" bttv" >>/etc/modprobe.d/bttv fi case $bt878_option in 1) # Generic BT8x8 # no options needed ;; 2) # configure ATI TV Wonder VE echo "options bttv card=64 radio=0 tuner=2" >> /etc/modprobe.d/bttv ;; x) # exit ;; *) # anything else echo; echo "\"$bt878_option\" is not a valid option." sleep 3 ;; esac done modprobe -r bt878 >> $dir/$debug 2>&1 modprobe -r bttv >> $dir/$debug 2>&1 modprobe bttv >> $dir/$debug 2>&1 cat /etc/modprobe.d/bttv >> $dir/$debug echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end configure BT8x8 Cards" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_6="done" } install_mythtv_packages() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start install MythTV" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug echo SET debconf/priority medium | debconf-communicate >> $dir/$debug 2>&1 echo "apt-get -y --force-yes install mythtv mythplugins" >> $dir/$debug apt-get -y --force-yes install mythtv mythplugins apt-get -y --force-yes install mythtv mythplugins >> $dir/$debug echo >> $dir/$debug echo SET debconf/priority critical | debconf-communicate >> $dir/$debug 2>&1 echo echo "create password for user 'mythtv'" passwd mythtv # workaround for permissions on MythTV 0.19 so regular user can # start MythTV and access database mkdir /mnt/store chmod 777 /mnt/store startx & >> $dir/$debug 2>&1 /etc/init.d/mythtv-backend stop >> $dir/$debug 2>&1 export DISPLAY=:0 >> $dir/$debug 2>&1 xhost + >> $dir/$debug 2>&1 su mythtv 'mythtv-setup' >> $dir/$debug 2>&1 killall Xorg >> $dir/$debug 2>&1 mythbackend & >> $dir/$debug 2>&1 echo "########################################" echo "IMPORTANT:" echo "please be patient while mythfilldatabase runs. It will take" echo "several minutes to complete downloading channel information" echo "you will not see any further messages on the screen!" echo "########################################" mythfilldatabase >> $dir/$debug 2>&1 startx & >> $dir/$debug 2>&1 export DISPLAY=:0 xhost + su mythtv 'mythfrontend' >> $dir/$debug 2>&1 xhost - >> $dir/$debug 2>&1 killall Xorg >> $dir/$debug 2>&1 # note: This is a work around to let a regular user start # mythfrontend and access the mythbackend. Otherwise only # root can access the mythbackend database. Maybe the new # procedure above will fix this (6 Feb 2006) chmod 777 /var/lib/mythtv chmod 777 /var/lib/mythtv/* # Apparently the above workaround is still required because when # MythTV 0.19 debian packages were released, the location of those # files changed and mythbackend will not start unless the permissions # are changed. The following line does the same workaround for 0.19 chmod 777 /mnt/store/* echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end install MythTV" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_5="done" } configure_mysql() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "configure MySQL" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug # if mythconverg database directory does not exist, # then create the mythconverg database if ! [ -d /var/lib/mysql/mythconverg ] then echo "please use caution, passwords will be visible" echo -n "please enter MySQL root password " read mysql_root_password # mysql_root_password not sent to $dir/$debug for security reasons mysqladmin -u root password $mysql_root_password # set access permission for MySQL user mythtv and create database echo -e "GRANT ALL PRIVILEGES ON *.* TO 'mythtv'@'localhost' \nIDENTIFIED BY 'mythtv' WITH GRANT OPTION; \ncreate database mythconverg; \nquit\n" | mysql -u root -p fi echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end configure MySQL" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_4="done" } add_required_mythtv_packages() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start add required MythTV packages" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug echo "this utility add packages required to run MythTV" echo -e "apt-get update" >> $dir/$debug apt-get update apt-get update >> $dir/$debug echo >> $dir/$debug # install mysql echo "apt-get -y --force-yes install mysql-client mysql-server mysql-common mysql-admin" >> $dir/$debug apt-get -y --force-yes install mysql-client mysql-server mysql-common mysql-admin apt-get -y --force-yes install mysql-client mysql-server mysql-common mysql-admin >> $dir/$debug echo >> $dir/$debug # install Xorg X Windowing System echo "apt-get -y --force-yes install xserver-xorg xbase-clients xterm fluxbox" >> $dir/$debug apt-get -y --force-yes install xserver-xorg xbase-clients xterm fluxbox apt-get -y --force-yes install xserver-xorg xbase-clients xterm fluxbox >> $dir/$debug echo >> $dir/$debug # install Xorg X Windows fonts echo "apt-get -y --force-yes install xfonts-base xfonts-100dpi xfonts-75dpi xfonts-scalable" >> $dir/$debug apt-get -y --force-yes install xfonts-base xfonts-100dpi xfonts-75dpi xfonts-scalable apt-get -y --force-yes install xfonts-base xfonts-100dpi xfonts-75dpi xfonts-scalable >> $dir/$debug echo >> $dir/$debug # install other useful programs echo "apt-get -y --force-yes install xmltv ssh rsh-server less binutils unzip" >> $dir/$debug apt-get -y --force-yes install xmltv ssh rsh-server less binutils unzip apt-get -y --force-yes install xmltv ssh rsh-server less binutils unzip >> $dir/$debug echo >> $dir/$debug echo echo "You are currently running Linux kernel version -"`uname -r` echo "The proposed upgrade to Linux kernel version "$kernel_extra echo -n "Would you like to upgrade Linux kernel (y/n) " read accept_kernel if [ $accept_kernel = "y" ] then # install up to date kernel, source, and headers echo "apt-get -y --force-yes install linux-image"$kernel_extra" linux-source linux-headers"$kernel_extra \ >> $dir/$debug apt-get -y --force-yes install linux-image$kernel_extra linux-source linux-headers$kernel_extra # the usual logging of apt-get is disabled because the new # Debian testing kernel upgrade is asking questions in a dialog # box. If the user initially asks to install a new kernel and # then answers "no" to the dialog box the second apt-get will # sit there asking a question the user will never see because # stdout is piped to the $debug file. This is a bug # and it needs fixing, if I can ever figure out how. # apt-get -y install linux-image$kernel_extra linux-source linux-headers$kernel_extra >> $dir/$debug echo >> $dir/$debug # This is probably another bug. Instead of making symlink from # /usr/src/linux-source-2.6.x it just copies the linux source into # /usr/src/linux. I can't get the symlink to work with a wildcard. # Seems to work anyway. Kernel source and headers needed for NVidia echo "decompressing linux kernel sources which may take a few minutes" tar -jxf /usr/src/linux-source*.tar.bz2 >> $dir/$debug 2>&1 mv linux-source* /usr/src/linux >> $dir/$debug 2>&1 # ln -s /usr/src/linux-source* /usr/src/linux >> $dir/$debug 2>&1 fi # install alsa echo "apt-get -y --force-yes install alsa-base alsa-utils alsa-oss" >> $dir/$debug apt-get -y --force-yes install alsa-base alsa-utils alsa-oss apt-get -y --force-yes install alsa-base alsa-utils alsa-oss >> $dir/$debug echo >> $dir/$debug # configure alsa clear alsa_option="y" echo "alsa_option="$alsa_option >> $dir/$debug 2>&1 while [ $alsa_option != "n" ] do echo "Recommend for all installs to configure ALSA at least once" echo -n "Would you like to configure ALSA (y/n)? " read alsa_config_ans if [ $alsa_config_ans = "y" ] then echo "alsa_config_ans="$alsa_config_ans >> $dir/$debug 2>&1 alsaconf fi echo echo "Recommend for all installs to run ALSA Mixer at least once" echo "If you type y, AMICUS will attempt to run ALSA Mixer" echo -n "Would you like to attempt to run ALSA Mixer (y/n)? " read alsa_mixer_ans echo if [ $alsa_mixer_ans = "y" ] then echo "alsa_mixer_ans="$alsa_mixer_ans >> $dir/$debug 2>&1 alsamixer fi echo echo "Recommend for all installs to test ALSA at least once" echo "If you type y, AMICUS will attempt to play an ALSA test sound" echo -n "Would you like to attempt to play an ALSA test sound (y/n)? " read alsa_test_ans echo if [ $alsa_test_ans = "y" ] then echo "alsa_test_ans="$alsa_test_ans >> $dir/$debug 2>&1 aplay /usr/share/sounds/alsa/Front_Center.wav fi echo echo "If you heard the words FRONT CENTER, then probably ALSA works" echo -n "Would you like to try to configure and/or test ALSA again? (y/n)" read alsa_option echo done # configure Xorg X server clear xserver_option="y" echo "xserver_option="$xserver_option >> $dir/$debug 2>&1 while [ $xserver_option != "n" ] do echo echo "Recommend for all installs to configure X at least once" echo -n "Would you like to configure X (y/n)? " read xserver_config_ans echo if [ $xserver_config_ans = "y" ] then echo "xserver_config_ans="$xserver_config_ans >> $dir/$debug 2>&1 dpkg-reconfigure xserver-xorg fi echo echo "Recommend for all installs to start X at least once" echo "If you type y, AMICUS will attempt to start X and then return in 60 seconds" echo -n "Would you like to attempt to start X (y/n)? " read xserver_start_ans echo if [ $xserver_start_ans = "y" ] then echo "xserver_start_ans="$xserver_start_ans >> $dir/$debug 2>&1 startx & sleep 60 killall Xorg sleep 10 clear fi echo echo -n "Would you like to try to configure and/or start X again? (y/n)" read xserver_option echo done echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end add required MythTV packages" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_3="done" } build_mythtv_dependencies_packages() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start build mythtv sources" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug echo "updates apt-get sources with latest Debian MythTV packages" echo >> $dir/$debug echo -e "apt-get update" >> $dir/$debug apt-get update apt-get update >> $dir/$debug echo >> $dir/$debug echo "apt-get -y --force-yes install gnupg" >> $dir/$debug apt-get -y --force-yes install gnupg apt-get -y --force-yes install gnupg >> $dir/$debug echo >> $dir/$debug # dialog is not needed by MythTV but is here for amicus script upgrade # in case I change add dialog boxes to the readline users io echo "apt-get -y --force-yes install dialog" >> $dir/$debug apt-get -y --force-yes install dialog apt-get -y --force-yes install dialog >> $dir/$debug echo >> $dir/$debug echo "apt-get -y --force-yes dist-upgrade" >> $dir/$debug apt-get -y --force-yes dist-upgrade apt-get -y --force-yes dist-upgrade >> $dir/$debug echo >> $dir/$debug echo "apt-get -y --force-yes build-dep mythtv" >> $dir/$debug apt-get -y --force-yes build-dep --force-yes mythtv apt-get -y --force-yes build-dep --force-yes mythtv >> $dir/$debug echo >> $dir/$debug echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end build mythtv sources" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_2="done" } update_apt_sources() { echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "start update apt-get sources" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug echo "updates apt-get sources with latest Debian MythTV packages" deb_option="t" echo "deb_option="$deb_option >> $dir/$debug 2>&1 debian_source="testing" echo "debian_source="$debian_source >> $dir/$debug 2>&1 while [ $deb_option != "x" ] do clear echo "Configure Debian apt-get Package Source MENU" echo echo "The Kernel Extra is \""$kernel_extra"\"" echo "The Debian apt-get Package Source is \""$debian_source"\"" echo echo "t. Testing (Recommended for Most Users)" echo "u. Unstable (Advanced Option Only)" echo "k. Set Custom Kernel Extra (Advanced Option Only)" echo echo "x. Exit, Return to Main Menu" echo echo -n "Please select an option: " read deb_option echo "deb_option="$deb_option >> $dir/$debug 2>&1 case $deb_option in t) # Set to Debian Testing debian_source="testing" ;; u) # Set to Debian Unstable debian_source="unstable" ;; k) # Set Custom Kernel Option echo echo "Please Enter the Custom Linux Kernel Extra Information" echo -n "For example,\""$kernel_extra"\" is default :" read kernel_extra ;; x) # exit ;; *) # anything else echo; echo "\"$deb_option\" is not a valid option."; sleep 3 ;; esac # clear done check_sources=`cat /etc/apt/sources.list | grep "AMICUS"` echo "check_sources ="$check_sources if [ "`echo $check_sources`" != "# UPDATED BY AMICUS" ]; then # add comment to /etc/apt/sources.list to prevent multiple updates echo "# UPDATED BY AMICUS" >> /etc/apt/sources.list echo >> /etc/apt/sources.list # Debian packages repository at the kernel.org mirror echo deb http://mirrors.kernel.org/debian/ $debian_source main contrib non-free >> /etc/apt/sources.list echo deb-src http://mirrors.kernel.org/debian/ $debian_source main contrib non-free >> /etc/apt/sources.list # probably obsolete # Christian Marillat's packages (0.18 only) (mythtv, mplayer, lame) echo deb ftp://ftp.nerim.net/debian-marillat/ sid main >> /etc/apt/sources.list echo deb-src ftp://ftp.nerim.net/debian-marillat/ sid main >> /etc/apt/sources.list #probably obsolete # Ubuntu Breezy Multiverse MythTV (0.18 and 0.17) packages for MythGame and MythPhone # ref http://www.gossamer-threads.com/lists/mythtv/users/176014?search_string=debian%20packages;#176014 # note: as of 6 Feb 2006, mythphone and mythgame still broken # their packages appear out of date with obsolete dependencies echo deb http://archive.ubuntu.com/ubuntu breezy multiverse >> /etc/apt/sources.list echo deb-src http://archive.ubuntu.com/ubuntu breezy multiverse >> /etc/apt/sources.list # ref http://deb.thehunter.ws/dists/breezy/mythtv-stable/ # all MythTV packages 0.19 echo deb http://deb.thehunter.ws/ breezy mythtv-stable >> /etc/apt/sources.list echo deb-src http://deb.thehunter.ws/ breezy mythtv-stable >> /etc/apt/sources.list fi echo >> $dir/$debug cat /etc/apt/sources.list >> $dir/$debug echo -e "apt-get update" >> $dir/$debug apt-get update apt-get update >> $dir/$debug echo >> $dir/$debug echo "apt-get -y --force-yes install lynx pciutils mindi mondo mindi-kernel" >> $dir/$debug apt-get -y --force-yes install lynx pciutils mindi mondo mindi-kernel apt-get -y --force-yes install lynx pciutils mindi mondo mindi-kernel >> $dir/$debug echo >> $dir/$debug echo echo "Preloading your apt cache will speed later steps" echo -n "Would you like to preload your apt cache (y/n) " read accept_preload if [ $accept_preload = "y" ] then apt-get update apt-get -d -y --force-yes dist-upgrade apt-get -d -y --force-yes build-dep mythtv apt-get -d -y --force-yes install mythtv mythplugins apt-get -d -y --force-yes install mythbrowser apt-get -d -y --force-yes install mythdvd mythgallery mythgame mythmusic apt-get -d -y --force-yes install mythnews mythphone mythvideo mythweather mythweb apt-get -d -y --force-yes install mysql-client mysql-server mysql-common mysql-admin apt-get -d -y --force-yes install xserver-xorg xbase-clients xterm fluxbox apt-get -d -y --force-yes install xfonts-base xfonts-100dpi xfonts-75dpi xfonts-scalable apt-get -d -y --force-yes install xmltv ssh rsh-server less binutils unzip apt-get -d -y --force-yes install linux-image$kernel_extra linux-source linux-headers$kernel_extra apt-get -d -y --force-yes install alsa-base alsa-utils alsa-oss apt-get -d -y --force-yes install subversion ntpdate portmap gnupg apt-get -d -y --force-yes install weblint ftp cvs tidy sysutils mozilla-firefox bluefish lynx if [ ! -e NVIDIA-Linux-x86-1.0-8178-pkg1.run ]; then wget http://download.nvidia.com/XFree86/Linux-x86/1.0-8178/NVIDIA-Linux-x86-1.0-8178-pkg1.run \ >> $dir/$debug 2>&1 fi if [ ! -e ivtv-0.4.2.tar.gz ]; then wget http://dl.ivtvdriver.org/ivtv/archive/0.4.x/ivtv-0.4.2.tar.gz >> $dir/$debug 2>&1 fi if [ ! -e pvr_2.0.24.23035.zip ]; then wget ftp://ftp.shspvr.com/download/wintv-pvr_150-500/inf/pvr_2.0.24.23035.zip >> $dir/$debug 2>&1 fi if [ ! -e pvr_1.18.21.22254_inf.zip ]; then wget ftp://ftp.shspvr.com/download/wintv-pvr_250-350/inf/pvr_1.18.21.22254_inf.zip >> $dir/$debug 2>&1 fi if [ ! -e lirc-0.8.0.tar.gz ]; then wget http://fresh.t-systems-sfr.com/linux/src/lirc-0.8.0.tar.gz >> $dir/$debug 2>&1 fi fi echo >> $dir/$debug echo "########################################" >> $dir/$debug echo "end update apt-get sources" >> $dir/$debug date >> $dir/$debug echo >> $dir/$debug step_1="done" } autoconfigure_tuners() { empty="" iTVC16_tuner_detected=`lspci | grep "Multimedia" | grep "iTVC16"` iTVC15_tuner_detected=`lspci | grep "Multimedia" | grep "iTVC15"` Bt878_tuner_detected=`lspci | grep "Multimedia" | grep "Bt878"` Bt848_tuner_detected=`lspci | grep "Multimedia" | grep "Bt848"` if [ "`echo $iTVC16_tuner_detected`" != "`echo $empty`" ] || [ "`echo $iTVC15_tuner_detected`" != "`echo $empty`" ] then echo "PVR-150/250/350/500 ivtv tuner detected" echo -n "Would you like to configure your ivtv tuner? (y/n)" read ans if [ $ans = "y" ] then configure_ivtv fi fi if [ "`echo $Bt878_tuner_detected`" != "`echo $empty`" ] || [ "`echo $Bt848_tuner_detected`" != "`echo $empty`" ] then echo "Bt878 tuner detected" echo -n "Would you like to configure your Bt878 tuner? (y/n)" read ans if [ $ans = "y" ] then configure_bt8x8 fi fi } check_new_AMICUS_CD_install() { echo -n "Is this a new install from the AMICUS CD ISO image? (y/n)" read accept_new if [ $accept_new = "y" ] then base-config echo "Please change default password for root" passwd root echo "Please change default password for user 'amicus'" passwd amicus fi } print_main_menu() { echo "A.M.I.C.U.S. MAIN MENU" echo echo "i. Install MythTV" if [ $1 = "I" ] then echo " 1. Update apt sources "$step_1 echo " 2. Build MythTV Dependencies Packages "$step_2 echo " 3. Add Required MythTV Packages "$step_3 echo " 4. Configure MySQL "$step_4 echo " 5. Install MythTV Packages "$step_5 echo " p. All of the Above (one step) "$step_p fi echo echo "c. Configure System" if [ $1 = "C" ] then echo " 6. Configure BT8x8 bttv Tuner Card "$step_6 echo " 7. Configure NVidia Video Card "$step_7 echo " 8. Configure PVR-x50 ivtv Tuner Card "$step_8 echo " 9. Configure LIRC ATI Remote Wonder "$step_9 echo " d. Compile MythTV from source "$step_d echo " e. Automatic Clock Synchronization "$step_e echo " f. Automatic MythTV on boot "$step_f echo " g. Compile XViD/x264/MPlayer from source "$step_g echo " j. Configure Frontend Only system "$step_j fi echo echo "u. Utilities for MythTV" if [ $1 = "U" ] then echo " a. Install MythTV Plugins" echo " b. Remove MythTV Plugins" echo " s. Run mythtv-setup" echo " t. Launch mythtv-backend" echo " k. Stop mythtv-backend" echo " r. Restart mythtv-backend" echo " n. Run mythfilldatabase" echo " m. Launch mythfrontend" echo " z. Install AMICUS Utilities" fi echo echo "h. Help and About Information" echo " (first must select Install MythTV -> Update apt sources)" echo echo "x. Exit and Dump Debug Info" echo echo -n "Please select an option: " } # AMICUS Script Starts Here # setup global variables dir="`pwd`" menu_mode="K" debug="amicus_debug_`date +'%G%m%d%H%M%S'`.txt" kernel_extra="-2.6.15-1-486" step_1="not done" step_2="not done" step_3="not done" step_4="not done" step_5="not done" step_p="not done" step_6="not done" step_7="not done" step_8="not done" step_9="not done" step_d="not done" step_e="not done" step_f="not done" step_g="not done" step_j="not done" step_a="not done" step_b="not done" step_s="not done" step_t="not done" step_k="not done" step_r="not done" step_m="not done" step_z="not done" insert_delimiter "begin amicus" insert_delimiter "dir="$dir insert_delimiter "menu_mode="$menu_mode insert_delimiter "kernel_extra="$kernel_extra # set debconf priority to critical to reduce unnecessary apt-get questions echo SET debconf/priority critical | debconf-communicate >> $dir/$debug 2>&1 check_new_AMICUS_CD_install autoconfigure_tuners while [ true ] do clear print_main_menu $menu_mode read menu_option insert_delimiter "menu_option="$menu_option case $menu_option in " " ) # top menu mode menu_mode=" " ;; i) # install menu mode menu_mode="I" ;; c) # configure menu mode menu_mode="C" ;; u) # utility menu mode menu_mode="U" ;; h) # get online help and about information lynx http://amicus.sourceforge.net ;; 1) # update apt sources update_apt_sources ;; 2) # build MythTV dependencies packages build_mythtv_dependencies_packages ;; 3) # add required MythTV packages add_required_mythtv_packages ;; 4) # Configure MySQL configure_mysql ;; 5) # Install MythTV Packages install_mythtv_packages ;; p) # All of the Above (one step) update_apt_sources build_mythtv_dependencies_packages add_required_mythtv_packages configure_mysql install_mythtv_packages step_p="done" ;; 6) # Configure BT8x8 Cards configure_bt8x8 ;; 7) # Configure NVidia Video Cards configure_nvidia ;; 8) # Configure ivtv Tuner Card configure_ivtv ;; 9) # Configure LIRC configure_lirc ;; d) # Compile MythTV from source compile_mythtv_from_source ;; e) # Automatic Clock Synchronization automatic_clock_synchronization ;; f) # Automatic MythTV Frontend on Boot automatic_mythtv_on_boot ;; g) # compile MPlayer/XViD/x264 from source compile_mplayer_from_source ;; j) # Configure Frontend Only system configure_frontend_only ;; a) # Install MythTV Plugins install_mythtv_plugins ;; b) # Remove MythTV Plugins remove_mythtv_plugins ;; z) # Install AMICUS Utilities install_AMICUS_utilities ;; t) # Start MythTV Backend start_mythtv_backend_utility ;; k) # Stop MythTV Backend stop_mythtv_backend_utility ;; r) # Restart MythTV Backend restart_mythtv_backend_utility ;; m) # Start MythTV Frontend mythtv_frontend_utility ;; n) # Load the MythTV Channel and Schedule information database mythfilldatabase_utility ;; s) # Start the MythTV Setup utility mythtv_setup_utility ;; x) # Dump Debug Info and exit dump_debug_info exit ;; *) echo echo "\"$menu_option\" is not a valid option." sleep 3 ;; esac echo echo -n "press enter to return to the Main Menu " read bogus # clear done