Fully automated rooting script

Everything about rooting Toons 1 and 2.

Moderators: marcelr, TheHogNL, Toonz

Post Reply
Markie13
Starting Member
Starting Member
Posts: 19
Joined: Sat May 05, 2018 9:16 pm

Re: Fully automated rooting script

Post by Markie13 »

marcelr wrote:It's not a JTAG problem. How do you load the custom bootloader through JTAG if you can't type anything in your serial console?
I open one console via Putty serial baud 115200
Other one via telnet 4444
And the last one an openocd console. So i have 3 consoles open.

The serial console is where i can see the password ect but cannot add some characters
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post by TheHogNL »

martenjacobs wrote:Hi everyone,

Over the last few days I've been busy working on a Python application that will automate the rooting process of Toon from a Raspberry Pi.
It supports rooting using just the serial port on Toons with U-Boot versions with a known password, and will use JTAG on any other Toon.

If you want to check it out, it's on GitHub.
Just posted a pull request for a modified version of your patching script so it will include a root password (which is 'password') instead of defaulting to no password.
Member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Fully automated rooting script

Post by marcelr »

@Markie13:

Sounds like a serial IO issue. Are you sure RxD and TxD are in the right place? Is your serial converter working properly with other hardware?
Markie13
Starting Member
Starting Member
Posts: 19
Joined: Sat May 05, 2018 9:16 pm

Re: Fully automated rooting script

Post by Markie13 »

marcelr wrote:@Markie13:

Sounds like a serial IO issue. Are you sure RxD and TxD are in the right place? Is your serial converter working properly with other hardware?
I will answer this in your topic Marcel
RoadXY
Member
Member
Posts: 111
Joined: Wed Oct 21, 2015 8:11 am

Re: Fully automated rooting script

Post by RoadXY »

I had the same problem. Turns out you have to connect ground in order to be able to send data to your Toon
martenjacobs
Member
Member
Posts: 53
Joined: Fri Mar 09, 2018 4:13 pm

Re: Fully automated rooting script

Post by martenjacobs »

Just posted a pull request for a modified version of your patching script so it will include a root password (which is 'password') instead of defaulting to no password.
After a minor change (password is now randomly generated on the fly due to security reasons) this is now merged. I'll try to make some time in the coming weeks to change the generation of an SSH key pair to an option. For most users, it's easier to use a password. Maybe I'll add an option to let the user specify the password as well.
martenjacobs
Member
Member
Posts: 53
Joined: Fri Mar 09, 2018 4:13 pm

Re: Fully automated rooting script

Post by martenjacobs »

Markie13 wrote:
marcelr wrote:It's not a JTAG problem. How do you load the custom bootloader through JTAG if you can't type anything in your serial console?
I open one console via Putty serial baud 115200
Other one via telnet 4444
And the last one an openocd console. So i have 3 consoles open.

The serial console is where i can see the password ect but cannot add some characters
A thought: you're not leaving the consoles open while running the script, right? If the socket is in use while the script tries to write data to it, it'll probably cause I/O errors much like the ones you're experiencing.
rickvnl
Starting Member
Starting Member
Posts: 10
Joined: Thu Apr 05, 2018 1:20 am

Re: Fully automated rooting script

Post by rickvnl »

Ran this script a while ago when I bought a second hand Toon. Was perfect and had a rooted toon... since yesterday I guess.

There was an update said Toon and my girlfriend had hit the update button. Now my apps are gone. Is it unrooted now?
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Fully automated rooting script

Post by marcelr »

Nope.

But you will have to add the apps manually to /qmf/qml/qb/base/Globals.qml again.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Fully automated rooting script

Post by Toonz »

marcelr wrote:Nope.

But you will have to add the apps manually to /qmf/qml/qb/base/Globals.qml again.
But he cannot do this if the iptables config has been reset by the official update. I guess he will have to root again
member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Fully automated rooting script

Post by marcelr »

Toonz wrote: .. he cannot do this if the iptables config has been reset by the official update. I guess he will have to root again
Right. Forgot about that one...
Prutzer
Starting Member
Starting Member
Posts: 16
Joined: Thu Feb 01, 2018 12:46 pm

Re: Fully automated rooting script

Post by Prutzer »

When is the new version with the option to disable the SSH key pair going to be released?

I tried the auto root with a raspberry pi 1 rev 2. I failed:

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-R8
INFO:rooter:Using password to log in
INFO:rooter:Logging in to U-Boot
INFO:rooter:Patching U-Boot
INFO:rooter:Waiting for boot up
INFO:rooter:Transferring payload
INFO:rooter:Patching Toon
INFO:rooter:>>> Enabling root user. Your root password is: XXXXXX
INFO:rooter:Cleaning up
INFO:rooter:Rebooting
INFO:rooter:Your Toon is now rooted. Please wait for it to boot up and try to log in using SSH

But when i try to connect:
pi@raspberrypi:~/ToonRooter $ ssh -i id_rsa root@192.168.1.18
ssh: connect to host 192.168.1.18 port 22: Connection timed out

What am I doing wrong?
Prutzer
Starting Member
Starting Member
Posts: 16
Joined: Thu Feb 01, 2018 12:46 pm

Re: Fully automated rooting script

Post by Prutzer »

Fixed it.

When i use this pin layout it worked.

JTAG connector Toon --> Rapberry Pi GPIO (signal name)

1 --> NC (RTCK)
2 --> 24 (TRST)
3 --> 20 (GND)
4 --> 23 (TCK)
5 --> 6 or 25 (GND)
6 --> 22 (TMS)
7 --> 18 (SRST)
8 --> 19 (TDI)
9 --> NC (Vt)
10 --> 21 (TDO)

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-R8
INFO:rooter:Using password to log in
INFO:rooter:Logging in to U-Boot
INFO:rooter:Patching U-Boot
INFO:rooter:Waiting for boot up
INFO:rooter:Transferring payload
INFO:rooter:Patching Toon
INFO:rooter:>>> Enabling root user. Your root password is: XXXXXXX
INFO:rooter:>>> Opening ports 22, 80 and 10080 on firewall
INFO:rooter:>>> Installing dropbear
INFO:rooter:>>> Installing openssh-sftp-server
INFO:rooter:Cleaning up
INFO:rooter:Rebooting
INFO:rooter:Your Toon is now rooted. Please wait for it to boot up and try to log in using SSH

Thanks a lot! Nice script!
Last edited by Prutzer on Mon Jun 25, 2018 7:58 pm, edited 1 time in total.
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Fully automated rooting script

Post by marcelr »

Congrats, and thank you.

Good to see that people actually start reading when things don't work, instead of freaking out immediately.
There's many a forum that will envy us for that :mrgreen:
martenjacobs
Member
Member
Posts: 53
Joined: Fri Mar 09, 2018 4:13 pm

Re: Fully automated rooting script

Post by martenjacobs »

Prutzer wrote:Fixed it.

When i use this pin layout it worked.
(...)
Isn't that the same pin layout as described everywhere :D ?
What did you use before and where did you get it from?
Post Reply

Return to “Toon Rooting”