This is the script I run in a console before entering the root password in the KnoppMyth-run xterm (which I cant see until I have run the script and rebooted anyway). It is quite long winded but self explanatory. There are also a number of data files that the script uses (kernel sources, patches etc.) If anyone has problems locating the required files, let me know. I have posted an additional patch for the DVICO remote on the wiki.
Code:
# This is the script that I run once I have done a fresh install of
# KnoppMyth R5V15.1 to get everything working on my system.
#
# My system consists of:
# DVICO FusionHDTV DVB-T1
# #TV Excel PV-BT878P+ w/FM (aka Pixelview Pro or something.)
# MSI K7T266 Pro2 Mobo
# Athlon 1700+ XP processon
# 200Gbyte 8M cache Maxtor HDD
# 120Gbyte 8M cache Western Digital HDD
# GeForce2 Mx 400 Graphics Card
#
# I have this script on a 512 Meg USB MP3 player which I
# mount from the root account using the command:
#
# mount /dev/sda /mnt
#
# I then change directory to the directory containing this script and run it
# from the root account.
#
# cd /mnt/r5a15.1
# ./myth_post_install.bash
#
# Start by copying the contents of the directory containing this script to
# ~mythtv/.
date
cp -Rfvu `dirname $0`/* ~mythtv/
# My first problem when I tried to play with things to get them working was
# that I am used to using a modeless editor like emacs. The only editor I
# could find was vi which I am not familiar with and hence not comfortable
# with. I saw a discussion on Slashdot about the joe editor. Most people that
# liked it said it was because they could use it without being familiar with
# it (the instructions for getting help are displayed on the top line yadda
# yadda), so I downloaded it and have used it happily since.
if dpkg -l joe 2>&1 | grep -q "No packages found matching joe" ; then
dpkg -i ~mythtv/joe_2.9.8-1_i386.deb
else
echo "Joe already installed"
fi
# Install scan and tzap from linuxtv.
# cesman says with R5A15.1 he has built linuxtv apps from CVS, so no need to
# do this now
#if [ ! -d /usr/src/linuxtv-dvb-apps-1.1.0 ] ; then
# cd /usr/src
# tar xvfj linuxtv-dvb-apps-1.1.0.tar.bz2
# cd /usr/src/linuxtv-dvb-apps-1.1.0
# make
# cp -fv /usr/src/linuxtv-dvb-apps-1.1.0/util/szap/tzap /usr/local/bin
# cp -fv /usr/src/linuxtv-dvb-apps-1.1.0/util/scan/scan /usr/local/bin
#else
# echo "linuxtv dvb apps already installed"
#fi
# The DVICO has a driver written by Chris Pascoe. It has not made it
# properly into the kernel sources yet (although I think the Lite card works)
# so there are some patches on hios website for linux-2.6.11-rc4. These
# patches work with 2.6.11.7, so I am using that. The patches are in 2.6.12rc3
# but for some reason my card doesnt work with that kernel (other changes myst
# have broken it ;(
NEW_KERNEL=2.6.11.7
if [ ! -d /usr/src/linux-$NEW_KERNEL ] ; then
cd /usr/src
tar xvfj ~mythtv/linux-$NEW_KERNEL.tar.bz2
cd /usr/src/linux-$NEW_KERNEL
patch -p1 < ~mythtv/enable-dvico-dvb-2.6.11-rc4.diff
cp -fv ~mythtv/config.linux-$NEW_KERNEL /usr/src/linux-$NEW_KERNEL/.config
make
make install modules modules_install
rm -vf /usr/src/linux
ln -vs /usr/src/linux-$NEW_KERNEL /usr/src/linux
else
echo $NEW_KERNEL kernel already installed.
fi
# Update lilo to contain an entry for the new kernel and make it the
# default kernel.
if ! grep -q vmlinuz-$NEW_KERNEL$ /etc/lilo.conf ; then
# Update lilo.conf for the new kernel.
cp -fv /etc/lilo.conf /etc/lilo.conf.old
cat /etc/lilo.conf.old | \
awk '/^image=\/vmlinuz\.old/{print \
"image=/boot/vmlinuz-2.6.11.7\n" \
"\tlabel=Linux-2.6.11\n" \
"\tread-only\n"}{print $0}' |
sed 's/default=Linux/default=Linux-2.6.11/g' |
sed 's/#[ \t]prompt/prompt/g' |
sed 's/#[ \t]timeout=100/timeout=25/g' > /etc/lilo.conf
lilo
else
echo LILO already updated for new kernel.
fi
# I need NVTV to setup the TV-out of my GeForce MX 400 properly. There are a
# number of things that are required to set it up to run automatically,
# first off, create a script containing the nvtv command that I want to
# execute. This includes a normal overscan setting, an tvhoffset command to
# shiift the image horizontally on the tv to centre it, and saturation and
# contrast settings to get the picture looking a bit more natural.
if [ ! -e ~mythtv/do_nvtv.sh ] ; then
NVTV_SET="--set TVhoffset:8 --set Saturation:-30 --set Contrast#:10"
echo "nvtv -t -r 800,600 -s Normal $NVTV_SET" > \
~mythtv/do_nvtv.sh
chown mythtv:mythtv ~mythtv/do_nvtv.sh
chmod 755 ~mythtv/do_nvtv.sh
else
echo "Do nvtv script already created."
fi
# Now add a fluxbox startup command so that my nvtv command is run when
# gdm starts.
if ! grep -q do_nvtv /home/mythtv/.fluxbox/apps ; then
cp -fv /home/mythtv/.fluxbox/apps /home/mythtv/.fluxbox/apps.orig
cat /home/mythtv/.fluxbox/apps.orig | \
awk '/KnoppMyth-run/{print \
"[startup] {~mythtv/do_nvtv.sh}"}{print $0}' > \
/home/mythtv/.fluxbox/apps
else
echo "nvtv already set to run."
fi
# Now put a startup command for the nvtvd daemon in bootmisc.sh. This
# daemon must be running if a non-root user needs to execute an nvtv command.
if ! grep -q /usr/local/bin/nvtvd /etc/init.d/bootmisc.sh ; then
echo /usr/local/bin/nvtvd >> /etc/init.d/bootmisc.sh
else
echo nvtvd already started in bootmisc.sh
fi
# Now for the remote that comes with the DVICO. This begins another tale of
# woe. The dvico patches for lirc actually got into the lirc sources at
# version 0.7.1-rc3 I think, but the remote would not work with this
# version!! Instead, I have had to track down an old version of the lirc
# sources that the original DVICO patch was written for, apply the patch to
# it and rebuild it and then the remote works!
if [ ! -d /usr/src/lirc-0.7.0pre4 ] ; then
cd /usr/src
tar xvfj ~mythtv/lirc-0.7.0pre4.tar.bz2
cd /usr/src/lirc-0.7.0pre4
cat ~mythtv/lirc-0.7.0pre4-dvico.diff | patch -b -p1
./configure --with-driver=dvico --prefix=/usr
make
make install
else
echo LIRC sources already extracted. LIRC must have been built already.
fi
# Copy the lircrc for the remote into the location used by mythtv. This file
# includes a command for redoing the nvtv command (which i have to do if I
# switch to a console [ctrl-alt-f1] and then back to X [alt-f7]).
if ! grep -q DVICO ~mythtv/.mythtv/lircrc ; then
cp -fv ~mythtv/lircrc-dvico ~mythtv/.mythtv/lircrc
else
echo lircrc already installed to ~mythtv/.mythtv/lircrc
fi
# This is the lircd configuration file for the dvico.
if ! grep -q DVICO /etc/lircd.conf ; then
cp -fv ~mythtv/lircd.conf-dvico /etc/lircd.conf
else
echo lircd.conf already installed to /etc/lircd.conf
fi
# Get lircd to run at boot time.
if ! grep -q /usr/sbin/lircd /etc/init.d/bootmisc.sh ; then
echo "/usr/sbin/lircd --driver=dvico --device=/dev/usb/hiddev0" >> \
/etc/init.d/bootmisc.sh
else
echo lircd already set to run at boot
fi
# Get irxevent/irexec to run automatically when gdm starts.
if ! grep -q irxevent /home/mythtv/.fluxbox/apps ; then
echo "Inserting irxevents line"
cp -fv /home/mythtv/.fluxbox/apps /home/mythtv/.fluxbox/apps.no_irxevent
cat /home/mythtv/.fluxbox/apps.no_irxevent | \
awk '/KnoppMyth-run/{print \
"[startup] {irxevent}\n[startup] {irexec}"}{print $0}' > \
/home/mythtv/.fluxbox/apps
else
echo "irxevent already set to run"
fi
# The xterm fonts are too small to be read properly on my TV, so change the
# KnoppMyth-run script so that it creates an xterm with a larger font.
if ! grep -q "xterm -fn" /usr/local/bin/KnoppMyth-run ; then
echo "Adding large font xterm for /usr/local/bin/KnoppMyth-run."
cp /usr/local/bin/KnoppMyth-run /tmp/KM-run
cat /tmp/KM-run |
sed 's/xterm/xterm -fn *18*/g' > /usr/local/bin/KnoppMyth-run
else
echo "Large font xterm already added for /usr/local/bin/KnoppMyth-run."
fi
# Also change the default font sixe in the xterm brought up with Alt-X.
if ! grep -q "xterm -ls -fn" /etc/X11/fluxbox/keys ; then
echo "Adding large font xterm."
cp /etc/X11/fluxbox/keys /tmp/fluxbox_keys
cat /tmp/fluxbox_keys |
sed 's/xterm/xterm -ls -fn *18*/g' > /etc/X11/fluxbox/keys
else
echo "Large font xterm already added."
fi
# Now, I setup my card and did a DVB scan using mythtv-setup and then
# compared the database before and after the setup. To prevent the
# need to set it up each time I re-install, I have put the commands to
# modify the database in this script. I have also commented out all of the
# channel duplicates and HDTV channels that I dont want so that I am only
# left with the channels I want.
echo updating database with card,input and channel info.
echo "
DELETE FROM capturecard;
INSERT INTO capturecard VALUES (1,'0','','','DVB','DVBInput',NULL,'mythtv',0,0,0,1,8192,8192,0,0,0,0,2,0,NULL,0,0);
DELETE FROM cardinput;
INSERT INTO cardinput VALUES (1,1,1,'DVBInput',NULL,0,'N','','7',1,NULL,0,11700000,10600000,9750000);
DELETE FROM channel;
#INSERT INTO channel VALUES (1000,'20', NULL,1,'ABC HDTV','ABC HDTV','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,1,592,0);
INSERT INTO channel VALUES (1001,'2', NULL,1,'ABC Digital','ABC TV Adelaide','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,1,593,0);
INSERT INTO channel VALUES (1002,'1', NULL,1,'ABC2 Digital','ABC2','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,1,594,0);
#INSERT INTO channel VALUES (1003,'22', NULL,1,'ABC TV','ABC TV','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,1,595,0);
INSERT INTO channel VALUES (1004,'7', NULL,1,'7 Digital','7 Digital','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,2,1360,0);
#INSERT INTO channel VALUES (1005,'71', NULL,1,'7 Digital 1','7 Digital 1','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',1,2,1361,0);
#INSERT INTO channel VALUES (1006,'72', NULL,1,'7 Digital 2','7 Digital 2','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',1,2,1362,0);
#INSERT INTO channel VALUES (1007,'73', NULL,1,'7 Digital 3','7 Digital 3','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',1,2,1363,0);
#INSERT INTO channel VALUES (1008,'70', NULL,1,'7 HD Digital','7 HD Digital','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,2,1364,0);
#INSERT INTO channel VALUES (1009,'77', NULL,1,'7 Guide','7 Guide','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,2,1366,0);
INSERT INTO channel VALUES (1010,'9', NULL,1,'NINE Digital','NINE Digital','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',1,3,1105,0);
#INSERT INTO channel VALUES (1011,'1112',NULL,1,'NINE HD','NINE HD','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',1,3,1112,0);
#INSERT INTO channel VALUES (1012,'1', NULL,1,'TEN Digital','TEN Digital','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,4,1617,0);
#INSERT INTO channel VALUES (1013,'13', NULL,1,'TEN Digital 1','TEN Digital 1','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,4,1618,0);
#INSERT INTO channel VALUES (1014,'14', NULL,1,'TEN Digital 2','TEN Digital 2','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,4,1619,0);
#INSERT INTO channel VALUES (1015,'15', NULL,1,'TEN Digital 3','TEN Digital 3','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,4,1620,0);
INSERT INTO channel VALUES (1016,'10', NULL,1,'TEN Digital','TEN Digital','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,4,1621,0);
#INSERT INTO channel VALUES (1017,'11', NULL,1,'TEN Guide','TEN Guide','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,4,1623,0);
#INSERT INTO channel VALUES (1018,'12', NULL,1,'TEN HD','TEN HD','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,4,1624,0);
#INSERT INTO channel VALUES (1019,'100', NULL,1,'TEN Guide','TEN Guide','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,4,1625,0);
#INSERT INTO channel VALUES (1020,'30', NULL,1,'SBS HD','SBS HD','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,5,832,0);
INSERT INTO channel VALUES (1021,'28', NULL,1,'SBS Digital','SBS DIGITAL 1','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,5,833,0);
#INSERT INTO channel VALUES (1022,'33', NULL,1,'SBS DIGITAL 2','SBS DIGITAL 2','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,5,834,0);
#INSERT INTO channel VALUES (1023,'31', NULL,1,'SBS EPG','SBS EPG','none',NULL,'','',0,32768,32768,32768,32768,'Default',0,1,'',0,5,835,0);
DELETE FROM dtv_multiplex;
INSERT INTO dtv_multiplex VALUES (1,1,593,4112,781625000,'a',NULL,'auto',NULL,'auto','7','auto','a','auto',0,'auto','a','auto','dvb',27,20050430155732);
INSERT INTO dtv_multiplex VALUES (2,1,1285,4115,732500000,'a',NULL,'auto',NULL,'auto','7','auto','a','auto',0,'auto','a','auto','dvb',4,20050430155752);
INSERT INTO dtv_multiplex VALUES (3,1,1,12849,795500000,'a',NULL,'auto',NULL,'auto','7','auto','a','auto',0,'auto','a','auto','dvb',15,20050430155811);
INSERT INTO dtv_multiplex VALUES (4,1,1541,4116,711500000,'a',NULL,'auto',NULL,'auto','7','auto','a','auto',0,'auto','a','auto','dvb',14,20050430155827);
INSERT INTO dtv_multiplex VALUES (5,1,832,12802,760625000,'a',NULL,'auto',NULL,'auto','7','auto','a','auto',0,'auto','a','auto','dvb',8,20050430155859);
DELETE FROM videosource;
INSERT INTO videosource VALUES (1,'Television','tv_grab_au','','default',NULL,NULL);
" | mysql mythconverg
Still to do:
Patch the kernel so the DVICO remote does multiple input events when a button is held down.
Work out how to use nuv2disk to burn shows to DVD.
Complete development of commercial_cut for using the cutlist to do cut only mpeg transcodes.
I'm also having trouble with the location of the OSD when wating live TV and changing channels.
Use the second hard disk in an LVM configuration so I get > 300 Gig for /myth