Richard Loxley
12-01-2007, 03:23 PM
I've just invested in a 32" LCD, so wanted to activate mode 0 (high resolution, high bitrate recording) but I don't have a network card in the Tivo.
The best tutorial I found was http://www.tivocommunity.com/tivo-vb/showthread.php?t=286938 but the consensus seems to be that you can only install this hack with a network connection because you have to run scripts on the Tivo to do the mod.
So I invented a way to do it, which I present here :)
This assumes you are comfortable with removing your Tivo drives and putting them in a PC (e.g. if you've done a drive upgrade).
First connect the drives. I used the following arrangement, if you connect them differently you'll have to adjust the drive letters:
DOS disk on primary master (hda)
CDROM (boot) on primary slave (hdb)
Tivo disk on secondary master (hdc)
In Windows put following files in c:\tivo
fpga7114.o.lj
iicsetw
rc.sysinit.author
runonce.sh
setupMode0.tcl
I wrote runonce.sh and created a modified rc.sysinit.author, but the other 3 are unmodifed versions of the files written by other people. For convenience I've attached all 5 in one zipfile.
Boot from your favourite Tivo upgrade boot CD, remembering to enable byteswapping, e.g. on a standard MFS Tools CD, use the following at the boot: prompt
vmlnodma hdc=bswap
Mount the DOS disk:
mkdir /mnt/dos
mount /dev/hda1 /mnt/dos
Mount the Tivo var partition:
mkdir /mnt/var
mount /dev/hdc9 /mnt/var
Find the Tivo root partition; first try
mkdir /mnt/root
mount /dev/hdc4 /mnt/root
ls -l /mnt/root
umount /mnt/root
If you get the message "Must specify filesystem type", it's not hdc4. Next try
mount /dev/hdc7 /mnt/root
ls -l /mnt/root
umount /mnt/root
If only one suceeded, that's the partition you need. If both worked, whichever had the newest dates on the files was the correct one.
Now mount the correct one:
mount /dev/hdc4 /mnt/root
or
mount /dev/hdc7 /mnt/root
Replace the fpga module (fixes position of the image in mode 0 and adjusts some other display parameters, see http://www.ljay.org.uk/tivoweb/tivo_fpga.html for details):
cd /mnt/root/lib/modules
mv fpga7114.o fpga7114.o.original
cp /mnt/dos/tivo/fpga7114.o.lj fpga7114.o
Create the /mnt/var/hack files:
mkdir /mnt/var/hack
mkdir /mnt/var/hack/bin
cd /mnt/var/hack/bin
cp /mnt/dos/tivo/runonce.sh .
cp /mnt/dos/tivo/iicsetw .
chmod 755 *
Set up the runonce directory:
mkdir /mnt/var/hack/runonce
cd /mnt/var/hack/runonce
cp /mnt/dos/tivo/setupMode0.tcl .
chmod 755 *
Modify the startup scripts to call the runonce script and iicsetw every time the Tivo boots up:
cd /mnt/root/etc/rc.d
ls -l
If rc.sysinit.author is not there or zero size, copy the new one over:
cp /mnt/dos/tivo/rc.sysinit.author .
If you already have a rc.sysinit.author, then you probably have a disk image which already contains hacks. You can append the new lines to the file with
cat /mnt/dos/tivo/rc.sysinit.author >> rc.sysinit.author
But then you'll have to edit rc.sysinit.author with vi or joe to make sure it makes sense. Ask here for advice if you're not sure.
Unmount the partitions:
cd
umount -f -a -r
control><alt><delete>
Wait for the PC to restart and then power off.
Remove the disk and put it in the Tivo. Boot up Tivo, wait 5 minutes after boot to ensure the "runonce" scripts have run, then reboot if necessary.
The runonce script will run everytime the Tivo boots up. It checks the directory /var/hack/runonce for any executable files, executes them, and then moves them to the directory /var/hack/runoncedone. That way they will be executed once, and then never again unless you move them back to the /var/hack/runonce directory.
It is executed 3 minutes after the Tivo boots up, to allow anything else relevant to start up. You should therefore wait at least 5 minutes after starting the Tivo to make sure it has run before rebooting (assuming your change needs a reboot to take affect - which I believe the mode 0 modification does).
For the mode 0 modification make sure save disk space is enabled in the Tivo set up pages.
You can check the results of the runonce script by putting the disk back in the PC and:
Boot from relevant CD (remember byteswapping)
Mount the Tivo var partition:
mkdir /mnt/var
mount /dev/hdc9 /mnt/var
cat /mnt/var/log/runonce
Which if everything went well, will look something like this:
Sat Dec 1 17:51:28 localtime 2007
Executing /var/hack/runonce/setupMode0.tcl
Resources for BEST mode set to Mode 0 (bobones settings) values
Sat Dec 1 17:51:35 localtime 2007
Moving /var/hack/runonce/setupMode0.tcl
This file lists the date and time and filename of every file executed. Any output or errors from the scripts executed will also appear in the file after the filename. If the files don't execute remember to check they have execute permissions (chmod 755 <filename>).
You can also check the new bitrates are being used by looking in the log file:
mkdir /mnt/dos
mount /dev/hda1 /mnt/dos
cp /mnt/var/log/tvlog /mnt/dos/tivo
This saves the tvlog file so you can look at it in your favourite text editor later. Search for the string "VBR", which will only appear if you have set "save disk space" to yes, and have the new bit rates. You should see lines such as:
Dec 1 18:01:58 (none) TmkMediaswitch::Trace[133]: using VBR, bitRate=4800000, maxBitrate=9000000
if it's worked. Search also for CBR, which will list the bit rates when "save disk space" is turned off, or if the original (non-VBR) bit rates are still being used:
Feb 21 07:29:58 (none) TmkMediaswitch::Trace[128]: using CBR, bitRate=5960000, maxBitrate=5960000
You'll probably have a mixture of both, before and after the upgrade, so check the dates.
Remember to unmount the partitions and shutdown cleanly:
cd
umount -f -a -r
control><alt><delete>
Note that although this just worked successfully for me, you have to do this at your own risk!
It's also worth noting that once you've set this up, you can pull the drive, copy anything into /var/hack/runonce and it will run it exactly once on the Tivo. Thus almost any hack can be installed using this technique :)
Just remember to check the paths in your scripts, as you'll have to put the main script in /var/hack/runonce, but any other files the script needs should be in a different directory to ensure they are not executed themselves.
The best tutorial I found was http://www.tivocommunity.com/tivo-vb/showthread.php?t=286938 but the consensus seems to be that you can only install this hack with a network connection because you have to run scripts on the Tivo to do the mod.
So I invented a way to do it, which I present here :)
This assumes you are comfortable with removing your Tivo drives and putting them in a PC (e.g. if you've done a drive upgrade).
First connect the drives. I used the following arrangement, if you connect them differently you'll have to adjust the drive letters:
DOS disk on primary master (hda)
CDROM (boot) on primary slave (hdb)
Tivo disk on secondary master (hdc)
In Windows put following files in c:\tivo
fpga7114.o.lj
iicsetw
rc.sysinit.author
runonce.sh
setupMode0.tcl
I wrote runonce.sh and created a modified rc.sysinit.author, but the other 3 are unmodifed versions of the files written by other people. For convenience I've attached all 5 in one zipfile.
Boot from your favourite Tivo upgrade boot CD, remembering to enable byteswapping, e.g. on a standard MFS Tools CD, use the following at the boot: prompt
vmlnodma hdc=bswap
Mount the DOS disk:
mkdir /mnt/dos
mount /dev/hda1 /mnt/dos
Mount the Tivo var partition:
mkdir /mnt/var
mount /dev/hdc9 /mnt/var
Find the Tivo root partition; first try
mkdir /mnt/root
mount /dev/hdc4 /mnt/root
ls -l /mnt/root
umount /mnt/root
If you get the message "Must specify filesystem type", it's not hdc4. Next try
mount /dev/hdc7 /mnt/root
ls -l /mnt/root
umount /mnt/root
If only one suceeded, that's the partition you need. If both worked, whichever had the newest dates on the files was the correct one.
Now mount the correct one:
mount /dev/hdc4 /mnt/root
or
mount /dev/hdc7 /mnt/root
Replace the fpga module (fixes position of the image in mode 0 and adjusts some other display parameters, see http://www.ljay.org.uk/tivoweb/tivo_fpga.html for details):
cd /mnt/root/lib/modules
mv fpga7114.o fpga7114.o.original
cp /mnt/dos/tivo/fpga7114.o.lj fpga7114.o
Create the /mnt/var/hack files:
mkdir /mnt/var/hack
mkdir /mnt/var/hack/bin
cd /mnt/var/hack/bin
cp /mnt/dos/tivo/runonce.sh .
cp /mnt/dos/tivo/iicsetw .
chmod 755 *
Set up the runonce directory:
mkdir /mnt/var/hack/runonce
cd /mnt/var/hack/runonce
cp /mnt/dos/tivo/setupMode0.tcl .
chmod 755 *
Modify the startup scripts to call the runonce script and iicsetw every time the Tivo boots up:
cd /mnt/root/etc/rc.d
ls -l
If rc.sysinit.author is not there or zero size, copy the new one over:
cp /mnt/dos/tivo/rc.sysinit.author .
If you already have a rc.sysinit.author, then you probably have a disk image which already contains hacks. You can append the new lines to the file with
cat /mnt/dos/tivo/rc.sysinit.author >> rc.sysinit.author
But then you'll have to edit rc.sysinit.author with vi or joe to make sure it makes sense. Ask here for advice if you're not sure.
Unmount the partitions:
cd
umount -f -a -r
control><alt><delete>
Wait for the PC to restart and then power off.
Remove the disk and put it in the Tivo. Boot up Tivo, wait 5 minutes after boot to ensure the "runonce" scripts have run, then reboot if necessary.
The runonce script will run everytime the Tivo boots up. It checks the directory /var/hack/runonce for any executable files, executes them, and then moves them to the directory /var/hack/runoncedone. That way they will be executed once, and then never again unless you move them back to the /var/hack/runonce directory.
It is executed 3 minutes after the Tivo boots up, to allow anything else relevant to start up. You should therefore wait at least 5 minutes after starting the Tivo to make sure it has run before rebooting (assuming your change needs a reboot to take affect - which I believe the mode 0 modification does).
For the mode 0 modification make sure save disk space is enabled in the Tivo set up pages.
You can check the results of the runonce script by putting the disk back in the PC and:
Boot from relevant CD (remember byteswapping)
Mount the Tivo var partition:
mkdir /mnt/var
mount /dev/hdc9 /mnt/var
cat /mnt/var/log/runonce
Which if everything went well, will look something like this:
Sat Dec 1 17:51:28 localtime 2007
Executing /var/hack/runonce/setupMode0.tcl
Resources for BEST mode set to Mode 0 (bobones settings) values
Sat Dec 1 17:51:35 localtime 2007
Moving /var/hack/runonce/setupMode0.tcl
This file lists the date and time and filename of every file executed. Any output or errors from the scripts executed will also appear in the file after the filename. If the files don't execute remember to check they have execute permissions (chmod 755 <filename>).
You can also check the new bitrates are being used by looking in the log file:
mkdir /mnt/dos
mount /dev/hda1 /mnt/dos
cp /mnt/var/log/tvlog /mnt/dos/tivo
This saves the tvlog file so you can look at it in your favourite text editor later. Search for the string "VBR", which will only appear if you have set "save disk space" to yes, and have the new bit rates. You should see lines such as:
Dec 1 18:01:58 (none) TmkMediaswitch::Trace[133]: using VBR, bitRate=4800000, maxBitrate=9000000
if it's worked. Search also for CBR, which will list the bit rates when "save disk space" is turned off, or if the original (non-VBR) bit rates are still being used:
Feb 21 07:29:58 (none) TmkMediaswitch::Trace[128]: using CBR, bitRate=5960000, maxBitrate=5960000
You'll probably have a mixture of both, before and after the upgrade, so check the dates.
Remember to unmount the partitions and shutdown cleanly:
cd
umount -f -a -r
control><alt><delete>
Note that although this just worked successfully for me, you have to do this at your own risk!
It's also worth noting that once you've set this up, you can pull the drive, copy anything into /var/hack/runonce and it will run it exactly once on the Tivo. Thus almost any hack can be installed using this technique :)
Just remember to check the paths in your scripts, as you'll have to put the main script in /var/hack/runonce, but any other files the script needs should be in a different directory to ensure they are not executed themselves.