Page 6 of 30

Re: Fully automated rooting script

Posted: Thu May 10, 2018 8:54 am
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

Re: Fully automated rooting script

Posted: Thu May 10, 2018 9:06 am
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.

Re: Fully automated rooting script

Posted: Thu May 10, 2018 1:16 pm
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?

Re: Fully automated rooting script

Posted: Thu May 10, 2018 2:14 pm
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

Re: Fully automated rooting script

Posted: Thu May 10, 2018 9:26 pm
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

Re: Fully automated rooting script

Posted: Fri May 11, 2018 11:33 am
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.

Re: Fully automated rooting script

Posted: Fri May 11, 2018 11:37 am
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.

Re: Fully automated rooting script

Posted: Tue May 15, 2018 10:16 pm
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?

Re: Fully automated rooting script

Posted: Tue May 15, 2018 10:19 pm
by marcelr
Nope.

But you will have to add the apps manually to /qmf/qml/qb/base/Globals.qml again.

Re: Fully automated rooting script

Posted: Tue May 15, 2018 10:57 pm
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

Re: Fully automated rooting script

Posted: Wed May 16, 2018 8:28 am
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...

Re: Fully automated rooting script

Posted: Sun Jun 24, 2018 7:05 pm
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?

Re: Fully automated rooting script

Posted: Sun Jun 24, 2018 8:15 pm
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!

Re: Fully automated rooting script

Posted: Mon Jun 25, 2018 8:49 am
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:

Re: Fully automated rooting script

Posted: Tue Jun 26, 2018 8:48 am
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?