Started with a blank disk.
Installed the custom TiVo linux OS. Created an arbitrary size empty MFS
partition. Used TCL scripts, populated the MFS database with the required
structures and files (font, sounds, images, loopsets, swsystem). Ended up with
functional TiVo. Get it ?
|
Why ? |
Primarily, as a proof of concept. The source files (about 400Mb -
do not compress significantly) form a complete TiVo backup. You can take any size disk and
make any size MFS partition. |
|
Why not ? |
Definitely not for
beginners. Getting the source files is a
real cunt and not a pretty one either. |
·
Philips 14hr TiVo
v1.3
o
Ethernet on TiVo
o
nfs.o, 8390.o, tivone.o,
/tvbin/fsmake, /devbin,
/kernel/vmlinux.px
·
Win2K PC (or linux PC)
o
ethernet (duh!)
o
NFS server software
o
half a gig free disk space.
·
Maxtor 80Gb hard drive.
·
The “source files” collection.
The plan is to take the blank
Maxtor, use a functional TiVo or a PC with DBD
to prep the disk. Boot a temporary custom linux on the primary root with
network support but with no media drivers so as to be able to start up even
though the MFS is trashed/nonexistent. Continue to prep the disk, put the full
linux boot on the alternate root, build the MFS and load it with data. Reboot
on the alternate root of the now fully functional TiVo.
I started with a clean Maxtor by
fitting it as a slave drive to TiVo and running dd bs=1048576 if=/dev/zero
of=/dev/hdb overnight. Obvious faster ways are to plug it into a PC and run
a low level format with PowerMax or plug it into a linux PC with DMA enabled
and "dd" it there, whatever. I wanted a blank Maxtor to ensure that
there was no leftover data on the disk. I needed to prove that a functional
TiVo could be installed from the ground up.
I partitioned the disk by hand (from the TiVo):
pdisk -d
/dev/hdb
i
C 2p 2M
"Bootstrap 1" Image
C 3p 2M
"Kernel 1" Image
C 5p 2M
"Bootstrap 2" Image
C 6p 2M
"Kernel 2" Image
C 7p 128M
"Root 2" Ext2
C 8p 64M
"Linux swap" Swap
C 9p 128M
"/var" Ext2
C 10p 512M
"MFS application region" MFS
C 11p 11p
"MFS media region" MFS
x
m
11
x
w
y
q
That basically initializes the disk with a fresh
empty partition, then creates the standard needed OS partitions and finally
ends up using the rest of the disk (about 75Gb) for the final MFS media region.
Next I need to get that disk bootable with a minimal linux OS with
network support.
Using TiVo’s pdisk trashes the bootpage so I
re-made:
bootpage -D
/dev/hdb
I’m gonna set /dev/hda3 as primary and /dev/hda6
as secondary kernel
bootpage -B 3
-A 6 -P "root=/dev/hda4 runideturbo=false runmyworld=false
shondss=true" /dev/hdb
I rebooted
at this point just to make sure the paritition table is re-read. Then made a swap file
mkswap
/dev/hdb8
Put the kernel on the primary kernel partition
(if the kernel file isn’t there I’d just copy the respective /dev/hda
partition).
dd
if=/kernel/vmlinux.px of=/dev/hdb3
At this point I cheated a little, as my TiVo was
already upgraded to v2.0.1 luckily I had an image of a v1.3 root partition I’d
backed up a while ago. While it’s entirely feasible to build the root partition
entirely from scratch, make the directories, make the devices in /dev/, etc,
etc I wanted to get on with the boring bits and go to building the MFS
partitions so I just:
bzip2 -c -d
/mnt/root.bz2 | dd bs=512 conv=sync of=/dev/hdb4
That ensured I had a bootable
primary root on version 1.3 but I still needed some goodies on it so I mounted
it:
mount /dev/hdb4 /var/mnt
Make sure that
/var/mnt/var/tmp/ResourceContent exists, if not create it, it’s important.
The files I needed to make sure
I absolutely had, were “8390.o tivone.o nfs.o
fsmake”. I stuck them in /var/mnt/tvbin for now
since this root partition is only temporary while I set up the TiVo and can be
blown away when I’m done. Also I made sure that MFS
drivers don’t start, by commenting out the
“momstart –m” around lines 278 of /var/mnt/etc/rc.d/rc.sysinit then added the
following lines at the end:
export
PATH=/bin:/sbin:/tvbin:/devbin
export
MFS_DEVICE=”/dev/hda10 /dev/hda11”
export
TIVO_RESOURCE_CONTENT_HOST=192.168.69.10
export
TIVO_RESOURCE_CONTENT_PATH=/g/backups/build
export TIVO_ROOT=/var/tmp/ResourceContent
export
TIVO_PUBLISH_ROOT=/var/tmp/ResourceContent
export
RESOURCE_CONTENT_MOUNT_PATH=/var/tmp/ResourceContent/tvlib/data/Resource/en-US/Philips
insmod –f
/tvbin/8390.o
insmod –f
/tvbin/tivone.o
insmod –f
/tvbin/nfs.o
ifconfig eth0
192.168.69.123 up
tnlited 23
/bin/bash -login &
mount
$TIVO_RESOURCE_CONTENT_HOST:$TIVO_RESOURCE_CONTENT_PATH $TIVO_ROOT
The above rc.sysinit sets up some important
environment variables, sets up the networking and a telnet daemon and sets up and
mounts an NFS share. The variables TIVO_RESOURCE_CONTENT_HOST,
TIVO_RESOURCE_CONTENT_PATH are my Win2k (or
linux) NFS server IP and shared path where the files I will be using reside.
Also I didn’t take care of the /var (aka
/dev/hdb9) as it will be recreated by rc.sysinit on the next reboot. Finally I
reboot this puppy:
umount /var/mnt
restart
Pulled the original drive and made the Maxtor the primary. When it comes up I can telnet in. At this point I’m running entirely off the Maxtor drive which is totally blank (zeroed out) except for the tivo kernel in /dev/hda3 and a slightly customized linux root partition in /dev/hda4.
Typing export will check that the environment variables in rc.sysinit have been set up and exported properly as they are critical. If not, I could export them manually. Also typing mount verifies that the NFS share is mounted.
The first thing I need to do is set up the MFS filesystem as I only have empty (blank) partitions there:
fsmake -cInodes
100000 -force
Started the MFS daemon with:
momstart –m
Verified it started OK by going in tivosh
amd typing:
mls /
exit
Since the MFS is empty, I ony got back:
Directory of /:
Name Type
FsId Date Time
Size
---- ----
---- ----
---- ----
Then I started the
final install script off the mounted NFS share:
$TIVO_ROOT/tvbin/tivosh
$TIVO_ROOT/tvlib/tcl/tv/load-all.tcl
Watched the pretty scrolling for about half an hour.
Tivo is now restored to factory fresh, pristine condition. If I were to reboot
on the alternate root it would ask me to perform a Guided Setup as there is
absolutely no guide data in it so I instead dbloaded a custom headend
slice for my locale (yeah I’m not in the States) then executed a nifty TCL
script that simulated a Guided Setup for the previously loaded custom headend.
Ok at this point I still do not have a bootable alternate root not to mention I
still have v1.3 on, so I copied the files off /var/tmp/ResourceContent/current
into /var/packages and gunzipped them. These are the files for the 2.0.1
software version. I then loaded them in the MFS, commented out the reboot in
installSw.tcl and executed finishInstall.tcl which took care of making a valid
alternate root, upgrading my tivo to 2.0.1 and ungracefully exiting without
rebooting which is what I wanted.
This was now the perfect time to bring in all
the customizations and place then on the alternate root before rebooting so I
copied my hack directory off a NFS share, changed rc.sysinit, and restarted.
Voila! Perfectly restored TiVo with one nice big MFS partition filling up the
Maxtor 80Gb disk and the latest 2.0.1 software on – all without even wasting
www.tivo.com’s bandwidth. All I need now is another 80Gb disk and I’ll be set J
This was performed under v1.3 TiVo software.
In
\tvlib\data\Resource\en-US\Philips\sound the files rightleft_2.pcm,
leftright_2.pcm are copies of pagedown_2.pcm, pageup_2.pcm respectively since
they didn't exist on any tivo I’d seen but are referenced by
\tvlib\data\resourcelist\sounds.list
Or I could have just taken them out of that list. Either-either,
whatever.
I put the files on a PC and NFS share it out
read only. Being a Billy_bitch™ I had the files on a Win2K PC with a
NFS server installed and shared them out of G:\backups\build. I would have used
native windows shares but SMABA for TiVo is busted, so there. Technically you
don’t need ethernet to do this. For example when partitioning the disk, you
could reserve 512Mb and make another ext2fs partition there, then put all the
required files there by connecting the drive to a PC. Then instead of NFS
mounting /var/tmp/ResourceContent, just mount this extra partition.
Feel free to ask me for copies of the files used
in this install and I will feel free to ignore your request. Did someone say
copyright ? Where did I get all these files ? All the scripts I gathered off
various TiVo’s usually left over from factory installs, a bit like the /devbin
directory. The font, sounds and image files were extracted right out of the MFS
using TCL commands in tivosh. Finally the mpeg files in loopset/* were
extracted with a utility I wrote earlier, PlayStream. The catch is
that the files such extracted with PlayStream will have to be demultiplexed
(really trivial coding – my private PlayStream does that). The demultiplexed
audio will need to be cleaned (I also wrote a CleanMPEG that does that, as the
demultiplexed sound files contain 16 byte sequences through them that shouldn’t
be there). If the mpeg streams are not demultiplexed and the audio is not
cleaned the above install will totally fail (ele2pestriple import will fail and
TiVo reboots).
This is a complete list
of my NFS share structure and files. Technically not all of that is
required, the main requirements are the files under tvlib\data\ (schema files,
sound files, image files, etc) and a bunch of scripts under tvlib\tcl\tv and
\tvbin
A few of the TCL scripts and source data files have to be tweaked for the upgrade to 2.0.1 to go smoothly.
Ummm… that’s all folks.
d18c7db
aka (evil) Alex