Results 1 to 11 of 11

Thread: Hacking platform

  1. #1
    Join Date
    Dec 2004
    Posts
    831

    Hacking platform

    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?
    Having trouble with TyTool? Try TyTool Documentation
    Need to hack an S3 / THD? Try S3 Hacking Script

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    Quote Originally Posted by lrhorer View Post
    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 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.

  3. #3
    Join Date
    Dec 2004
    Posts
    831
    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.
    Having trouble with TyTool? Try TyTool Documentation
    Need to hack an S3 / THD? Try S3 Hacking Script

  4. #4
    Join Date
    Aug 2004
    Posts
    4,075
    Why not just start with a better linux distribution as a base?

  5. #5
    Join Date
    Dec 2004
    Posts
    831
    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.
    Last edited by lrhorer; 05-30-2008 at 08:18 PM.
    Having trouble with TyTool? Try TyTool Documentation
    Need to hack an S3 / THD? Try S3 Hacking Script

  6. #6
    Join Date
    Aug 2004
    Posts
    4,075
    Quote Originally Posted by lrhorer View Post
    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. 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 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.

  7. #7
    Join Date
    Dec 2004
    Posts
    831
    OK, I read through the release notes, but I'm not certain I follow. Are you saying I can simply issue the following commands

    Code:
    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?
    Having trouble with TyTool? Try TyTool Documentation
    Need to hack an S3 / THD? Try S3 Hacking Script

  8. #8
    Join Date
    Aug 2004
    Posts
    4,075
    Quote Originally Posted by lrhorer View Post
    OK, I read through the release notes, but I'm not certain I follow. Are you saying I can simply issue the following commands

    Code:
    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.

  9. #9
    Join Date
    Dec 2004
    Posts
    831
    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?
    Having trouble with TyTool? Try TyTool Documentation
    Need to hack an S3 / THD? Try S3 Hacking Script

  10. #10
    Join Date
    Aug 2004
    Posts
    4,075
    Quote Originally Posted by lrhorer View Post
    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.

  11. #11
    Join Date
    Dec 2004
    Posts
    831
    Quote Originally Posted by Jamie View Post
    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?"

    Quote Originally Posted by Jamie View Post
    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.

    Quote Originally Posted by Jamie View Post
    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.

    Quote Originally Posted by Jamie View Post
    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.
    Having trouble with TyTool? Try TyTool Documentation
    Need to hack an S3 / THD? Try S3 Hacking Script

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •