Fully automated rooting script

Everything about rooting Toons 1 and 2.

Moderators: marcelr, TerrorSource, Toonz, TheHogNL

Re: Fully automated rooting script

Postby Toonz » Thu Mar 22, 2018 9:34 am

Nice cable, I guess there is a market for it... :)
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1311
Joined: December 2016

Re: Fully automated rooting script

Postby TheHogNL » Thu Mar 22, 2018 9:52 pm

Like that cable also! Nice job.

Couldn't we build a getty outside of busybox (maybe 'agetty') and put that in inittab as the getty for rooted Toons? By doing this we never touch the native busybox so we can't break other important stuff. If we have the agetty there would be no reason anymore to not add it to the the script.
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1389
Joined: August 2017

Re: Fully automated rooting script

Postby marcelr » Thu Mar 22, 2018 10:11 pm

The custom busybox doesn't break anything. If you are really worried about installation failures, you can always back-up the original busybox and then install the new one. After successful completion of the installation, just remove the backup.
marcelr
Global Moderator
Global Moderator
 
Posts: 1083
Joined: May 2012
Location: Ehv

Re: Fully automated rooting script

Postby TheHogNL » Fri Mar 23, 2018 7:55 am

It is not the custom busybox but the possible cause that during the installation of the custom busybox some important files are lost during a power failure or unforseen reboot.

However, the possibility of this to happen is not that high. And Eneco also updates the busybox somewhere in 4.10 (could be earlier) and that didn't result in a lot of broken Toon also (we don't know the figures, but there is no mention about that in the Eneco forum). So installing the custom busybox using a script with opkg should be no problem. All busybox related issue's in this forum where caused by users making a error during thet ascii-transfer or trying to manually overwrite the buybox binary.

When I have some more time I'm also adding some installations of important packages in the update-script. Installing the custom busybox is one of them along with toonstore update.
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1389
Joined: August 2017

Re: Fully automated rooting script

Postby marcelr » Fri Mar 23, 2018 8:43 am

That's a non-issue. As said earlier, just back-up your busybox:
Code: Select all
cp /bin/busybox /bin/busybox-1.27.2-r1

and do the install. If that fails you can repair by reinstating busybox:
Code: Select all
/bin/busybox-1.27.2-r1 cp /bin/busybox-1.27.2-r1 /bin/busybox

and you're good to go again for the next try.
marcelr
Global Moderator
Global Moderator
 
Posts: 1083
Joined: May 2012
Location: Ehv

Re: Fully automated rooting script

Postby Rudolf » Fri Mar 23, 2018 10:07 am

As an alternative the script could copy the fixed busybox and create symlinks for just the missing applets.
Rudolf
Member
Member
 
Posts: 119
Joined: December 2017

Re: Fully automated rooting script

Postby martenjacobs » Sun Mar 25, 2018 12:29 pm

@Rudolf that could be a nice compromise. I'll see if I find the time to script that somewhere in the coming weeks. If someone else has some time, I'm open to pull requests :D
martenjacobs
Member
Member
 
Posts: 52
Joined: March 2018

Re: Fully automated rooting script

Postby TheHogNL » Tue Mar 27, 2018 4:36 pm

Tried your script, but without using the PI's connectors. I was using a usb serial device (/dev/ttyUSB0).
With the extra command --serial /dev/ttyUSB0 it didn't detect the toon (while rebooting the toon).

I didn't take much time to figure out why. Just used 'screen /dev/ttyS0 115200' to connect to the toon and root it myself. Just as fast for me as this toon didn't need JTAG.

But maybe you can look into this. If it should have worked, don't take too much time. Probably my mistake then :)
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1389
Joined: August 2017

Re: Fully automated rooting script

Postby marcelr » Tue Mar 27, 2018 6:22 pm

Rudolf wrote:As an alternative the script could copy the fixed busybox and create symlinks for just the missing applets.

The links are only removed at the far end of the install. If it fails, they will stay as they are.
marcelr
Global Moderator
Global Moderator
 
Posts: 1083
Joined: May 2012
Location: Ehv

Re: Fully automated rooting script

Postby martenjacobs » Tue Mar 27, 2018 7:09 pm

TheHogNL wrote:Tried your script, but without using the PI's connectors. I was using a usb serial device (/dev/ttyUSB0).
With the extra command --serial /dev/ttyUSB0 it didn't detect the toon (while rebooting the toon).

I didn't take much time to figure out why. Just used 'screen /dev/ttyS0 115200' to connect to the toon and root it myself. Just as fast for me as this toon didn't need JTAG.

But maybe you can look into this. If it should have worked, don't take too much time. Probably my mistake then :)


The correct argument is --serial-port
martenjacobs
Member
Member
 
Posts: 52
Joined: March 2018

Re: Fully automated rooting script

Postby TheHogNL » Wed Mar 28, 2018 11:46 am

martenjacobs wrote:The correct argument is --serial-port


Pretty sure I did that (after reading the help) but i'll check tonight :)
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1389
Joined: August 2017

Re: Fully automated rooting script

Postby rickvnl » Thu Apr 05, 2018 12:24 am

I ran the script tonight but got an error.

Code: Select all
pi@raspberrypi:~/ToonRooter $ sudo python . --jtag-available
INFO:__main__:Starting up...
INFO:__main__:Written private and public key pair to ./id_rsa and ./id_rsa.pub, respectively
INFO:rooter:Waiting for Toon to restart
INFO:rooter:Toon has U-Boot version 2010.09-R10
INFO:rooter:Loading new bootloader
INFO:rooter:Starting openocd
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/pi/ToonRooter/__main__.py", line 91, in <module>
    boot_only = boot_only)
  File "./rooter.py", line 22, in root
    do_root(port, ssh_pubkey_data, has_jtag, check_uboot, cleanup_payload, reboot_after, boot_only)
  File "./rooter.py", line 52, in do_root
    start_bootloader("assets/u-boot.bin")
  File "./rooter.py", line 177, in start_bootloader
    ], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory


Can someone tell me what I'm doing wrong? Thank you for a reply and for the great work!
rickvnl
Starting Member
Starting Member
 
Posts: 9
Joined: April 2018

Re: Fully automated rooting script

Postby TheHogNL » Thu Apr 05, 2018 8:52 am

Do you have openocd installed? At that point of the script it starts the openocd and I think it is missing. Read the readme of the tool
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1389
Joined: August 2017

Re: Fully automated rooting script

Postby rickvnl » Thu Apr 05, 2018 2:05 pm

TheHogNL wrote:Do you have openocd installed? At that point of the script it starts the openocd and I think it is missing. Read the readme of the tool

Yes, I just followed the readme but I constanly get this error
rickvnl
Starting Member
Starting Member
 
Posts: 9
Joined: April 2018

Re: Fully automated rooting script

Postby rickvnl » Thu Apr 05, 2018 3:56 pm

TheHogNL wrote:Do you have openocd installed? At that point of the script it starts the openocd and I think it is missing. Read the readme of the tool


Got in! Rooted... I guess :D

How do I login with SSH? ssh root@<IP> works, ssh key is generated but root user asks for password.
rickvnl
Starting Member
Starting Member
 
Posts: 9
Joined: April 2018

PreviousNext

Return to Toon Rooting

Who is online

Users browsing this forum: No registered users and 1 guest

cron