# Did I bork my DTivo?



## thepicman (May 5, 2004)

I think I killed my rc.sysinit.author  

FTP & telnet are dead (no, its not the router or ip)

Serial cable gives me connection info, but no bash. The session file is attached, but the end of it looks like this:

ApgManager Transition from state INIT to BOOT
....started status session
....sending Booting event
....sending Booting event
iptables: No chain/target/match by that name
Scanning for phase4 repair scripts
Running boot Stage G_PostApplication scripts
/etc/rc.d/rc.sysinit: /etc/rc.d/rc.sysinit.author: No such file or directory
rc.sysinit is complete
ApgManager Transition from state BOOT to FAST_LOAD
ApgManager Transition from state FAST_LOAD to FAST_LOAD
ApgManager Transition from state FAST_LOAD to FAST_LOAD
ApgManager Transition from state FAST_LOAD to FAST_LOAD
ApgManager Transition from state FAST_LOAD to FAST_LOAD
ApgManager Transition from state FAST_LOAD to FAST_LOAD
ApgManager Transition from state FAST_LOAD to STEADY_STATE
....sending Done event
....sending Done event

I really don't want to pull the drive again as the Tivo is stacked on, am I hosed?

-TPM


----------



## puffdaddy (Mar 1, 2006)

This is the significant part:

```
/etc/rc.d/rc.sysinit: /etc/rc.d/rc.sysinit.author: No such file or directory
```
You've screwed the pooch. Either your rc.sysinit.author is missing, misnamed, or has incorrect permissions; and as such, it is not being executed. So if you're starting serial bash and telnet in there, you'll need to pull the drive.


----------



## MungoJerrie (Mar 30, 2006)

thepicman said:


> I think I killed my rc.sysinit.author


Looks like you did.


> /etc/rc.d/rc.sysinit: /etc/rc.d/rc.sysinit.author: No such file or directory


As you surmised, this is bad, it can't find the file.


> I really don't want to pull the drive again as the Tivo is stacked on, am I hosed?


Looks like you're gonna have to pull the drive.


----------



## thepicman (May 5, 2004)

puffdaddy said:


> This is the significant part:
> 
> ```
> /etc/rc.d/rc.sysinit: /etc/rc.d/rc.sysinit.author: No such file or directory
> ...


Yes, that was the last file I edited. Using a new version of CuteFTP and I think the editor in it changed and is now adding unix-unfriendly things. I'll find a better text editor and then pull the drive so I can re-author my author file.

Thanks!

-TPM


----------



## JWThiers (Apr 13, 2005)

thepicman said:


> I think I killed my rc.sysinit.author
> 
> FTP & telnet are dead (no, its not the router or ip)
> 
> ...


In serial after the boot is done, hit enter a couple of times and see if you get bash then. If so cd to the author directory and run dos2unix on it. make sure you mount rw.


----------



## Da Goon (Oct 22, 2006)

A good way to avoid borking your connection is to put a very simple test.conf file in root that just starts bash and sets a temporary path. That way it gets started almost immediately in the boot cycle and if you mess up your author, you've still got serial bash

```
#!/bin/bash
#
export PATH=./:.:/bin:/sbin:/tvbin:/hacks:/busybox:/devbin
# start serial bash as early as possible
/bin/bash </dev/ttyS2&> /dev/ttyS2&
```
Also if you start bash this way, you can get in much sooner during boot, so if you screwed something up bad, ie. installing incompatible usb modules or erroneously patching tivoapp, and are stuck in a reboot loop, you should have time to kill rc.sysinit and fix it before it reboots again.


----------



## thepicman (May 5, 2004)

JWThiers said:


> In serial after the boot is done, hit enter a couple of times and see if you get bash then. If so cd to the author directory and run dos2unix on it. make sure you mount rw.


yes, I did that. The connection would not give me bash. After I puled the drive and looked at the rc.sysinit.author file, there were carriage returns at the end of each line. 

Thanks!

TPM


----------



## JWThiers (Apr 13, 2005)

Da Goon said:


> A good way to avoid borking your connection is to put a very simple test.conf file in root that just starts bash and sets a temporary path. That way it gets started almost immediately in the boot cycle and if you mess up your author, you've still got serial bash
> 
> ```
> #!/bin/bash
> ...


So you just put that in the root directory and chmod 777 and it runs on start???


----------



## Da Goon (Oct 22, 2006)

JWThiers said:


> So you just put that in the root directory and chmod 777 and it runs on start???


Yep, pretty much. Here's the relevant section from /etc/rc.d/rc.Sequence_000.SourceLocalConf.sh

```
# Read in our testing or feature configuration, if there is any.
echo "Scanning for configuration files"
for ConfFile in /etc/rc.d/*.conf /test.conf ; do
    [ ! -f $ConfFile ] || source $ConfFile
done
```
You can use it for several things. Personally I usually use it to check for a custom kernel for monte if needed, and then have it run another script for telnet/bash access (a la Alphawolf). It runs everything very early on in the boot process, this will start bash, etc before the splash screen even comes up.


----------



## JWThiers (Apr 13, 2005)

Cool!! 

Looks like you can also put anything.conf in the /etc/rc.d/, although I don't imagine it is recommended to do that. With test.conf in root it would get run last (in this sequence anyway).


----------



## thepicman (May 5, 2004)

Da Goon said:


> A good way to avoid borking your connection is to put a very simple test.conf file in root that just starts bash and sets a temporary path. That way it gets started almost immediately in the boot cycle and if you mess up your author, you've still got serial bash
> 
> ```
> #!/bin/bash
> ...


Very cool! question: what of that code will I need to remove from rc.sysinit.author?

TPM


----------



## Da Goon (Oct 22, 2006)

Just the */bin/bash </dev/ttyS2&>...* call to bash.


----------



## thepicman (May 5, 2004)

Da Goon said:


> Just the */bin/bash </dev/ttyS2&>...* call to bash.


Thanks!


----------

