PDA

View Full Version : Hacking platform



lrhorer
05-24-2008, 01:19 PM
I took Spike's MFS Live CD and migrated it to the hard drive of the PC I use to hack my TiVos. It works great, and I've written a couple of simple scripts which automate much of the hacking process. There is one little issue, however. The distribution which Spike distributes on his MFS Live CD requires a RAM Drive. I wrote a script to automatically build the RAM drive after I make modifications, but it won't run under the MFS Live boot. I have to boot to a regular Linux system, mount the MFS Live partition, and then run the script. That's a little bit of a pain in the tucus.

The issue is that creating the RAM drive image requires the following commands:

cpio -o -H newc
gzip -9 -n

The version of busybox supplied with MFS_Live says it only allows the switches d, i, m, t, u, v, and F for the cpio command. I don't know what switches are available for gzip, because it doesn't even report the switches, but in any case it also complains about the -n option. I need to be able to translate the -o, -H, and newc switches into something busybox cpio understands and -n into something busybox gzip understands.

I posted this query over on the MFS Live forum a couple of weeks ago, but Spike doesn't seem inclined to respond. Does anyone know who wrote the version of busybox Spike includes with his distro, or where I can get a listing of the command switches?

rbautch
05-28-2008, 11:41 PM
I took Spike's MFS Live CD and migrated it to the hard drive of the PC I use to hack my TiVos. It works great, and I've written a couple of simple scripts which automate much of the hacking process. There is one little issue, however. The distribution which Spike distributes on his MFS Live CD requires a RAM Drive. I wrote a script to automatically build the RAM drive after I make modifications, but it won't run under the MFS Live boot. I have to boot to a regular Linux system, mount the MFS Live partition, and then run the script. That's a little bit of a pain in the tucus.

The issue is that creating the RAM drive image requires the following commands:

cpio -o -H newc
gzip -9 -n

The version of busybox supplied with MFS_Live says it only allows the switches d, i, m, t, u, v, and F for the cpio command. I don't know what switches are available for gzip, because it doesn't even report the switches, but in any case it also complains about the -n option. I need to be able to translate the -o, -H, and newc switches into something busybox cpio understands and -n into something busybox gzip understands.

I posted this query over on the MFS Live forum a couple of weeks ago, but Spike doesn't seem inclined to respond. Does anyone know who wrote the version of busybox Spike includes with his distro, or where I can get a listing of the command switches?Here (http://www.busybox.net/downloads/BusyBox.html) is the list of busybox utilities and switches. If you need switches that aren't supported by the Busybox versions of cpio and gzip, then you could download the GNU source for the full featured versions of those utilities and compile your own.

lrhorer
05-30-2008, 09:57 AM
Thanks for the link.

Yeah, I thought of that, but obviously if the switches in busybox can be made to work it's a bit cleaner, plus I'll have to set up a cross compiler, which is additional work.

Jamie
05-30-2008, 10:26 AM
Why not just start with a better linux distribution as a base?

lrhorer
05-30-2008, 08:12 PM
If you know of one which is compatible with TiVo drive partitions (and SATA drives - these are S3 / THD TiVos), I'm all ears. I've got Debian "Etch" on the drive in a separate partition already. I'd prefer a relatively small distro, of course, but it doesn't have to be as tiny as MFS Live. I think the partition I set up for this is about 1.5G, IIRC. I wouldn't want a GUI, just a text login, and nothing like NTP, X11, DNS or SAMBA. Basic networking would be nice: ftp, ftpd, telnet, and telnetd would be handy.

If there's a moderately simple way to implement a TiVo savy driver for Debian, that would be great. I could then just boot to my regular Linux distro and use it to hack the TiVo drives, getting rid of the separate boot partition.

Jamie
05-30-2008, 11:38 PM
If you know of one which is compatible with TiVo drive partitions (and SATA drives - these are S3 / THD TiVos), I'm all ears. I've got Debian "Etch" on the drive in a separate partition already. I'd prefer a relatively small distro, of course, but it doesn't have to be as tiny as MFS Live. I think the partition I set up for this is about 1.5G, IIRC. I wouldn't want a GUI, just a text login, and nothing like NTP, X11, DNS or SAMBA. Basic networking would be nice: ftp, ftpd, telnet, and telnetd would be handy.

If there's a moderately simple way to implement a TiVo savy driver for Debian, that would be great. I could then just boot to my regular Linux distro and use it to hack the TiVo drives, getting rid of the separate boot partition.I primarily use Fedora, but there's nothing special about it. Any distribution should work.

There is no special driver requirement for handling tivo partitions. You can do it all in user space with the "revalidate" option of tivopart (http://www.dealdatabase.com/forum/showthread.php?t=25219). It requires a 2.4 kernel or newer, but that basically everything since ~2001. Any modern distribution should support SATA, with hotswap on hardware that supports on. If your SATA hardware doesn't support hotswap, scsiadd (http://llg.cubic.org/tools/scsiadd.html) lets you warm swap.

If for some reason you don't like having to use tivopart to grok the partition table, it's pretty easy to build a patched kernel for built in support.

lrhorer
05-31-2008, 12:22 AM
OK, I read through the release notes, but I'm not certain I follow. Are you saying I can simply issue the following commands


tivopart r /dev/sdb
mount /dev/sdb4 /drive
mount /dev/sdb9 /drive/var

and then start editing the TiVo drive? Do I need to do anything else special before mounting or after unmounting the drive partitions?

Jamie
05-31-2008, 12:43 AM
OK, I read through the release notes, but I'm not certain I follow. Are you saying I can simply issue the following commands


tivopart r /dev/sdb
mount /dev/sdb4 /drive
mount /dev/sdb9 /drive/var

and then start editing the TiVo drive? Do I need to do anything else special before mounting or after unmounting the drive partitions?Correct. For the hotswap case anyway. For warm swap, you also need to use scsiadd to add and remove the drive.

lrhorer
06-03-2008, 11:07 PM
Yeah, or just reboot with the drive attached. I believe the hardware on this machine supports hot swap.

I feel like such an *****. It never occurred to me there was a routine which would allow the TiVo partitions to be read and written from user space. I had always just rather assumed the code had to be compiled into the kernel, or least inserted as a module via insmod.

I should perform the tivopart call before I dd the kernel to the boot partition as well, correct?

Speaking of which, I haven't seen any references to the 9.3 custom kernel. I'm still using the 9.2 Kernel on my hacked THD. Are you going to post a custom 9.3 kernel?

Jamie
06-03-2008, 11:13 PM
Yeah, or just reboot with the drive attached. I believe the hardware on this machine supports hot swap.

I feel like such an *****. It never occurred to me there was a routine which would allow the TiVo partitions to be read and written from user space. I had always just rather assumed the code had to be compiled into the kernel, or least inserted as a module via insmod.[/url]I should perform the tivopart call before I dd the kernel to the boot partition as well, correct?You just need to call tivopart r once after the disk is hooked up. It reads the partition tables and informs the kernel about them via an ioctl.
Speaking of which, I haven't seen any references to the 9.3 custom kernel. I'm still using the 9.2 Kernel on my hacked THD. Are you going to post a custom 9.3 kernel?TiVo still hasn't posted linux kernel sources for the kernel in the 9.3 release. I have built 9.2 kernels, though I'm not sure I ever posted them. I don't think they are functionally different than the 8.x kernels.

lrhorer
06-05-2008, 02:55 AM
You just need to call tivopart r once after the disk is hooked up.
Oh, yes, that wasn't quite what I meant. I didn't mean to ask, "I should only call tivopart once?", but rather, "I should call tivopart first and then perform all the hacks, including the dd copy of the custom kernel?"


It reads the partition tables and informs the kernel about them via an ioctl.
'Right. The thing I don't recall is whether the unpatched Linux kernel can read and write the boot partitions without updating the partition table first. I know it can't mount the root partition or /var, but I'm not certain about the boot partitions. Of course, dd doesn't require the partition to be mounted, but I'm just a bit fuzzy on whether it will work on /dev/hda3 and /dev/hda6 prior to revalidating the partition table.


TiVo still hasn't posted linux kernel sources for the kernel in the 9.3 release. I have built 9.2 kernels, though I'm not sure I ever posted them.
I was mis-remembering. I believe the one I am running is the one you built from 8.1.7.


I don't think they are functionally different than the 8.x kernels.
Yeah, I haven't encountered any problems as far as I know.