Fully automated rooting script

Everything about rooting Toons 1 and 2.

Moderators: marcelr, TheHogNL, TerrorSource, Toonz

Re: Fully automated rooting script

Postby TerrorSource » Sat Jan 05, 2019 10:19 pm

TerrorSource wrote:
martenjacobs wrote:I've just merged the latest changes from the dev branch into master, thanks to legalr for testing.

Support has been added for all types of Pi's, and its now easier to add support for other JTAG debuggers by adding the correct config to the assets/adapters/ directory (if you've added support for one, please send me a PR).


Im not using the latest version but i noticed this issue:

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
INFO:rooter:Waiting for 10 seconds
INFO:rooter:Halting CPU
INFO:rooter:Loading new image to RAM
INFO:rooter:Starting up new image
INFO:rooter:Waiting for Toon to restart

Nothing happens after that. Toon boots up normally but the script is still paused.


Tried again with the latest version from github, problem still exists.

Code: Select all
pi@raspberrypi:~/ToonRooter $ sudo python . --jtag-available
INFO:__main__:Starting up...
INFO:__main__:Detected JTAG hardware 'rpi3'
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
INFO:rooter:Waiting for 10 seconds
INFO:rooter:Halting CPU
INFO:rooter:Loading new image to RAM
INFO:rooter:Starting up new image
INFO:rooter:Waiting for Toon to restart


Nothing happens, manual restart does not help as it does not picks up the edited u-boot img.

Any other way i can use the ToonRooter to open the u-boot?

sudo python . --jtag-available --dont-check-uboot
does not wait for the Toon to boot up btw.

DEBUG LOG:
Code: Select all
sudo python . --jtag-available --output-level DEBUG
INFO:__main__:Starting up...
INFO:__main__:Detected JTAG hardware 'rpi3'
INFO:__main__:Written private and public key pair to ./id_rsa and ./id_rsa.pub, respectively
DEBUG:__main__:{"has_jtag": true, "check_uboot": true, "boot_only": false, "reboot_after": true, "cleanup_payload": true, "port": "/dev/serial0", "jtag_hardware": "rpi3", "ssh_pubkey_data": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZpcv54a9LNl6jszYhcFfPLT86Ja1O4htYmeysEmcFvzDWmb0y3lIxzV8zrm8s9+PzarnCL3h6Pa4hKivT2uD7QdXdrl2ADO9lxuYrNMtufxalUV3JDbgXIR3cDfb+r9NwRopttiSyugCPQZzJKabxzyvF4hI++zAlnjakCc2orZUEb3E2D/Vz5BGMzpccChJ8FnGC2tF0hQTvkjvOP7TvHdRjmBw9StUrZDAWubHQwVVDmrZyDWzEOUC8QUPTHaG+UuSmKcpuKQ7Ptmi44oM2C8TIeH/YSnbIGAOlzXm38GDZ82Wa7oL2+P0zJuhpPYqrN+jpQfhEgHspUwOGGA9n"}
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
INFO:rooter:Waiting for 10 seconds
DEBUG:rooter:Open On-Chip Debugger
>
INFO:rooter:Halting CPU
DEBUG:rooter:soft_reset_halt
requesting target halt and executing a soft reset
Jazelle state handling is BROKEN!
target halted in Jazelle state due to debug-request, current mode: Supervisor
cpsr: 0xffffffd3 pc: 0x00000000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
>
DEBUG:rooter:reset halt
JTAG scan chain interrogation failed: all ones
Check JTAG interface, timings, target power, etc.
Trying to use configured scan chain anyway...
imx27.etb: IR capture error; saw 0x0f not 0x01
Bypassing JTAG setup events due to errors
WARNING: unknown debug reason: 0xf
ThumbEE -- incomplete support
target halted in ThumbEE state due to debug-request, current mode: System
cpsr: 0xffffffff pc: 0xfffffff9
MMU: enabled, D-Cache: enabled, I-Cache: enabled
srst pulls trst - can not reset into halted mode. Issuing halt after reset.
NOTE! Severe performance degradation without fast memory access enabled. Type 'help fast'.
>
INFO:rooter:Loading new image to RAM
DEBUG:rooter:load_image assets/u-boot.bin 0xa1f00000
WARNING: unknown debug reason: 0xf
ThumbEE -- incomplete support
timed out while waiting for target debug-running
166504 bytes written at address 0xa1f00000
downloaded 166504 bytes in 7.407528s (21.951 KiB/s)
>
INFO:rooter:Starting up new image
INFO:rooter:Waiting for Toon to restart


EXIT: Problem was re-doing all the wires. as the error "imx27.etb: IR capture error; saw 0x0f not 0x01" is a wiring issue.
TerrorSource
Member
Member
 
Posts: 201
Joined: May 2017

Re: Fully automated rooting script

Postby martenjacobs » Sat Jan 05, 2019 10:45 pm

TerrorSource wrote:(...)
EXIT: Problem was re-doing all the wires. as the error "imx27.etb: IR capture error; saw 0x0f not 0x01" is a wiring issue.


Yes, that's a common problem. As the script does no checking on the output from OpenOCD at all, wiring issues like these cause it to wait indefinitely. The trick is to manually check the output from OpenOCD by using the --debug flag
martenjacobs
Starting Member
Starting Member
 
Posts: 35
Joined: March 2018

Re: Fully automated rooting script

Postby aabre » Tue Jan 08, 2019 2:58 pm

Hi guys,
I'm stuck in the rooting script, checked and double checked al my connections but I can't find a connection problem,
I have a fresh started debian Pi and a get the next error

pi@raspberrypi:~/ToonRooter $ sudo python . --jtag-available
INFO:__main__:Starting up...
INFO:__main__:Detected JTAG hardware 'rpi3'
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
INFO:rooter:Waiting for 10 seconds
ERROR:rooter:
Traceback (most recent call last):
File "./rooter.py", line 206, in start_bootloader
client = telnetlib.Telnet('localhost', 4444)
File "/usr/lib/python2.7/telnetlib.py", line 211, in __init__
self.open(host, port, timeout)
File "/usr/lib/python2.7/telnetlib.py", line 227, in open
self.sock = socket.create_connection((host, port), timeout)
File "/usr/lib/python2.7/socket.py", line 575, in create_connection
raise err
error: [Errno 111] Connection refused
CRITICAL:__main__:[Errno 3] No such process


Can anybody give me a little push :D
User avatar
aabre
Starting Member
Starting Member
 
Posts: 23
Joined: November 2017
Location: Schiedam

Re: Fully automated rooting script

Postby TheHogNL » Tue Jan 08, 2019 6:29 pm

Openocd doesn't seem to start. Did you forgot to install that? https://github.com/martenjacobs/ToonRoo ... ll-openocd
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 662
Joined: August 2017

Re: Fully automated rooting script

Postby aabre » Tue Jan 08, 2019 7:53 pm

TheHogNL wrote:Openocd doesn't seem to start. Did you forgot to install that? https://github.com/martenjacobs/ToonRoo ... ll-openocd


Yes I have installed it as mentioned in the readme from Marten Jacob and there was no problems or error during installation

What I had to install was telnet and when I use telnet as a command I get:

pi@raspberrypi:/etc $ telnet localhost 4444
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

Is this a normal error (Connection refused) ? and it gives this error on any port number you want.

Only when I use telnet localhost <Enter> (without port number) it seems to work:

pi@raspberrypi:/etc $ telnet localhost
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Raspbian GNU/Linux 9
raspberrypi login:

Maybe Telnet gives the problem?
User avatar
aabre
Starting Member
Starting Member
 
Posts: 23
Joined: November 2017
Location: Schiedam

Re: Fully automated rooting script

Postby TheHogNL » Tue Jan 08, 2019 9:48 pm

telnet localhost 4444 only works when openocd is started ofcourse
See the part in the python code:
log.info("Starting openocd")

proc = subprocess.Popen([
'openocd',
'-s', '/usr/share/openocd',
'-f', 'assets/adapters/{}.cfg'.format(self._jtag_hardware),
'-f', 'assets/boards/ed20.cfg'
], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

try:


After this the telnet localhost 4444 is done. So check why openocd can't start with those paramters.
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 662
Joined: August 2017

Re: Fully automated rooting script

Postby aabre » Tue Jan 08, 2019 11:29 pm

Started over again with a clean Rpi3 Debian OS
Install Openocd according Git (Oke)
Install basic telnet client (Oke)

Start python:


pi@raspberrypi:~/ToonRooter $ sudo python . --jtag-available
INFO:__main__:Starting up...
INFO:__main__:Detected JTAG hardware 'rpi3'
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
INFO:rooter:Waiting for 10 seconds
INFO:rooter:Halting CPU
INFO:rooter:Loading new image to RAM
INFO:rooter:Starting up new image
INFO:rooter:Waiting for Toon to restart
INFO:rooter:Toon has U-Boot version 2010.09
INFO:rooter:Using password to log in
INFO:rooter:Logging in to U-Boot

Nothing happends after "Logging in to U-Boot"
User avatar
aabre
Starting Member
Starting Member
 
Posts: 23
Joined: November 2017
Location: Schiedam

Re: Fully automated rooting script

Postby aabre » Wed Jan 09, 2019 12:16 am

Found broken wire :?
Rooting works great Yehhhhhhh
Many thanks TheHogNl
User avatar
aabre
Starting Member
Starting Member
 
Posts: 23
Joined: November 2017
Location: Schiedam

Re: Fully automated rooting script

Postby Kingnl » Sun Jan 13, 2019 10:19 am

If i use this script on firmware 4.22.7 do i still need to install dropbrear?
Kingnl
Starting Member
Starting Member
 
Posts: 1
Joined: January 2019

Re: Fully automated rooting script

Postby TheHogNL » Sun Jan 13, 2019 1:14 pm

No this script will do that for you.
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 662
Joined: August 2017

Previous

Return to Toon Rooting

Who is online

Users browsing this forum: No registered users and 0 guests