A long time ago, d18c7db (evil_alex) posted instructions on how to use the fsmake and load-all.tcl utilities bundled with SA software v1.3 to construct an arbitrarily small (or large) MFS partition from scratch.

Times have changed, the TiVo software distribution has changed, and exporting/importing tystreams is no longer the hard part of the process. I am posting some utilities that may allow an intermediate or advanced S2 user to experiment with this himself.

This is for development purposes only; I am not attempting to provide a complete solution. No warranty, no assurance that this will work at all, yadda yadda. WORKSFORME.

The prerequisities for this project were:

1) A method of extracting and re-importing the following parts of the MFS hierarchy:

/Resource/LoopSet
/Resource/VideoClip (seems to be contained entirely within the LoopSet)
/Genre
/Component

I have modified mbm's dumpobj-tcl script to do this by traversing the filesystem and invoking mfs_export when appropriate.

If you notice any parts of the hierarchy I am missing, let me know.

2) Slice files for the software version you are trying to install. They can be captured during a phone call or possibly from a satellite download.

3) An image of a blank MFS filesystem, freshly initialized with fsmake. Included.

4) A copy of a working TiVo root filesystem and kernel image. 3.1u5 makes the job easier, and since you aren't starting myworld there's a good chance it will work on the newer DTiVo boards.

5) Another drive or another S2 TiVo, in working order, which has been compromised with BASH_ENV or a PROM hack, from which you can extract the needed resources.

6) A tar binary for the TiVo.

The basic steps I took were:

0) Read the original d18c7db document several times. It is included in the attachment.

1) Extract the resources from a working TiVo setup.

Boot the working TiVo and run resource_dump.tcl. It will create a tarball called resources.tgz which contains everything needed to reconstruct the necessary resources. Copy this tarball to your PC or something.

2a) Create a blank MFS filesystem.

I have done this and included it in the archive. I followed the d18c7db instructions up to "fsmake" on my S1, then messed with mfstools until I got the byte order right in the backup.

2b) mfsrestore the blank MFS filesystem to an empty drive

Use -x if you wish, or expand it later. It will fit on very small drives, which was the intent of this project. It will also fit on the stock 40GB drive and allow you to make larger root/swap partitions for hacking purposes, at the expense of recording space. I don't know of any reason why it wouldn't work with, say, a 200GB drive, if you are equipped for LBA48. This has not been tested.

3) Populate the non-MFS partitions.

This backup image ONLY contains hda10 and hda11; all other partitions are blank. Therefore you must populate hda6/hda7 with the kernel/root, mkswap on hda8, and write a valid bootpage to hda. Format /var while you're at it, since rc.sysinit isn't going to be running quite yet. Although my configuration was significantly more complex, you should be able to get away with a basic BASH_ENV hack, as long as you do not allow the virgin rc.sysinit to start myworld (don't fork bash into the background).

mke2fs -O none /dev/hda7
mke2fs -O none /dev/hda9
mkswap -v0 /dev/hda8
dd if=31u5kern.img of=/dev/hda6
bootpage ... blah blah

4) Start up the TiVo and get MFS running.

Power up the TiVo. Get MFS running. Something like:

export TIVO_ROOT=""
export MFS_DEVICE=/dev/hda10
mount -n /dev/hda9 /var
/tvbin/switcherstart -m

Other environment variables might be necessary. Maybe not. You'll find out.

5) Check to make sure MFS is okay.

Start up tivosh and mls /. Ensure that MFS is empty and accessible. If you're paranoid you might want to run fsfix - see rc.sysinit for the syntax.

6) Install the resources.

Transfer resources.tgz to this unit, unpack, and install:

cd /tmp
tar zxvf resources.tgz
export TIVOSH_POOLSIZE=16777216
cd work
tivosh resource_create.tcl

You may safely ignore any warnings about the poolsize being a few hundred bytes too big.

There's probably a way to use cpio to unpack the archive if you don't have tar. I don't remember it offhand.

<split here to make the forum software happy>