Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 31

Warning: include(http://archive.tivocommunity.com/tivo-vb/history/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 31

Warning: include() [function.include]: Failed opening 'http://archive.tivocommunity.com/tivo-vb/history/header.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 31
Pages:1



Need command or file to restore original hacks

(Click here to view the original thread with full colors/images)



Posted by: groundcrack

Someone mentioned a command, or file, once that would allow you to make a change in a hack, and if the Tivo didn't reboot correctly, it would automatically restore the original files. My description could be a little off here, but this is what I want to do:

Backup rcsysinit, move it to my PC via Bash. Edit it with textpad. Move it back to the tivo. Replace the current rcsysinit with the edited one. Make it executable, reboot the tivo. So, if something goes wrong, I want it to restore th rcsysinit with the rcsysinit.bak file & reboot. Am I crazy here, or is there a way to do that?

Thanks.



Posted by: classicsat

In theory, you could have a pre rc.sysinit which recognizes a boot parameter (something like repairsysinit=true), would copy a stable rc.sysinit and rc.sysinit.author, then launch rc.sysinit.

Looking /etc/inittab appears to call rc.sysinit, which you would call /etc/rc.d/rc.syscheck instead.

rc.syscheck could be:
#!/bin/bash

# check boot parameter, if true, copy backup sysinit
if [ "$repairsysinit" == true ]; then
/bin/cp /etc/rc.d/rc.sysinit.bak /etc/rc.d/rc.sysinit &
# if need be chmod it, but to be sure
/bin/chmod 755 /etc/rc.d
fi

#call rc.sysinit
/etc/rc.d/rc.sysinit

That is the gist of it, it could be fine-tuned to actually work, if it does.

What I do though, is have my OS installed to both OS partition sets, 7 being my hacked one, 4 being my nearly stock one (with only serial bash on it).

You set the boot parameter from the factory menu when you first plug in or reset the Tivo.



Posted by: classicsat

Attached is my refined script.

You can remove the portions regarding the restored.* flag and reboot .

If you wish to leave them in, you need to create a dummy file called /etc/rc.d/restored.false

You put the script in /etc/rc.d and chmod 755 it, and call it from rc.sysint, or maybe rc.sysinit.author.

You copy a good rc.sysinit to rc.sysinit.bak.

To activate restore you inculde the boot parameter repairsysinit=true, let it boot, and when it reboots the second time, remove the boot parameter, or change the parameter to false and thet it boot again.

So far, with the script called from the bottom of rc.sysinit, it works for me, except
the flag doesn't change back to false.

If you want to remove the restored and reboot stuff, you need to be sure to clear or set false the boot parameter, or every reboot the backup rc.sysinit will be restored.



Posted by: classicsat

Sorry, here is the script, just remove the .txt



Posted by: groundcrack

Wow....Thanks.

I can't believe that you wrote a script and tried it out and everything.

Thanks a Lot. I'll give it a shot.




Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 37

Warning: include(http://archive.tivocommunity.com/tivo-vb/history/footer.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 37

Warning: include() [function.include]: Failed opening 'http://archive.tivocommunity.com/tivo-vb/history/footer.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 37



vBulletin Copyright ©2000 - 2014, Jelsoft Enterprises Limited.
vB Easy Archive Final ©2000 - 2014 - Created by Stefan "Xenon" Kaeser Modified by Adam J. de Jaray