View Full Version : Replace initrd

07-19-2008, 07:15 PM
As soon as 9.4 posts to my TiVo HD, I intend to use the Linux port of Mr. Black51's replace_initrd to neuter the new kernel, and from now on I intend to neuter my own kernel rather than downloading a hacked one. I have some questions, however:

What will happen if I accidentally run the routine on an already neutered kernel? Glancing at the code, it doesn't jump out at me that it would do anything but replace the already null initrd with another null initrd, but does anyone have any actual experience with this?

If it does cause problems to run the program on an already-neutered kernel, then shy of writing and compiling another program to detect a null vs a non-null initrd, is there a simple method I can use to have my Linux script check to see if the kernel is already neutered?

07-19-2008, 07:34 PM
All replace_initrd does is check for the gzip signature and then dd in the initrd image of your choosing into that spot. If you run it again, it won't change anything unless you use a different initrd image. You can verify this by running it twice, and checking the kernel with md5sum before and after.

08-03-2008, 06:39 PM
Hopefully I'm just missing something simple here.

I've extracted the kernel from 9.4L on my prommed S3, and I am attempting to use replace_initrd to neuter it.

I'm using a command that is similar to the command posted by Captain Video in the S3 Overview thread.

/dos/replace_initrd.x86 /dos/tivo/vmlinux.px /dos/null-linuxrc.img.gz dos/original_kernel.bak

I have tried both the busybox and the regular version of NIllaZilla's compile of replace_initrd.x86 using both the PTV Boot disk, and the MFSLive disk. In either case I always get the message returned that replace_initrd.x86 was Not Found.

Any thoughts on what I could be doing wrong?



08-03-2008, 06:48 PM
you need to be pointing each argument in the direction that the actual file is in. if you don't have a replace_initrd.x86 file in /dos then you'll get that message. provide more information such as how you are mounting your drives.

08-03-2008, 10:53 PM
I am mounting the FAT32 drive by:

mount /dev/sdb1 /dos

when I do a ls after cd /dos

I see a replace_*.* (or however linux truncates files) so it sems like the file is in /dos.


08-03-2008, 11:04 PM
the mfslive boot cd will truncate the filenames. use the name that 'ls' displays. if it says 'replac~1' then use that. it's annoying.

if you still have issues, you can put the kernel on a pc and do it there, like under cygwin.

08-04-2008, 07:34 AM
I just rehacked my S3 the other day after finally getting the 9.4 update. I still use the PTVUpgrade boot disk and connect my SATA drive to my IDE bus using an SATA to IDE adapter so the boot disk sees it as an IDE drive. I've never had any problems getting the S3 drive hacked using this method. Just make sure whatever files you're using are all in the root directory of your FAT32 drive and it should work fine, regardless of which method you use.

08-04-2008, 10:08 AM
Try mounting like this for long filename support (mfslive supports vfat):
mount -t vfat /dev/sdb1 /dos

08-04-2008, 10:56 PM
Thanks all, it worked like a charm with the mfslive boot disk using the truncated file names.

08-10-2008, 03:04 AM
OK, whatever works. I just boot the PC to Debian "Etch" Linux, use tivopart -r to rescan the partitions on the TiVo drive, and then mount /dev/sdb6 (or /dev/sdb7) to /tivo and then mount /dev/sdb9 to /tivo/var. 'No filename truncation or any other artifiact. The root partition on the PC is a 500G riserfs partition, so no worries on file sizes, either.

08-10-2008, 03:08 AM
I've extracted the kernel from 9.4L on my prommed S3, and I am attempting to use replace_initrd to neuter it.
I just use replace_initrd.x86 to automatically make a copy of the kernel on the PCs hard drive and then hack the kernel in place.