Fully automated rooting script

Everything about rooting Toons 1 and 2.

Moderators: marcelr, TerrorSource, Toonz, TheHogNL

Re: Fully automated rooting script

Postby Floats » Mon Feb 17, 2020 8:02 pm

mAiden wrote:
Floats wrote:Having an issue with rooting my Toon

When I try to install openOCD :
Code: Select all
pi@raspberrypi:~ $ bash
pi@raspberrypi:~ $ git clone --recursive git://git.code.sf.net/p/openocd/code openocd
Cloning into 'openocd'...
remote: Enumerating objects: 62985, done.
remote: Counting objects: 100% (62985/62985), done.
remote: Compressing objects: 100% (26823/26823), done.
remote: Total 62985 (delta 51779), reused 43800 (delta 35996)
Receiving objects: 100% (62985/62985), 14.22 MiB | 4.93 MiB/s, done.
Resolving deltas: 100% (51779/51779), done.
Submodule 'jimtcl' (https://repo.or.cz/jimtcl.git) registered for path 'jimtcl'
Submodule 'src/jtag/drivers/libjaylink' (https://repo.or.cz/libjaylink.git) registered for path 'src/jtag/drivers/libjaylink'
Submodule 'tools/git2cl' (https://repo.or.cz/git2cl.git) registered for path 'tools/git2cl'
Cloning into '/home/pi/openocd/jimtcl'...
remote: Counting objects: 7715, done.       
remote: Total 7715 (delta 0), reused 0 (delta 0)        /s     
Receiving objects: 100% (7715/7715), 6.05 MiB | 4.17 MiB/s, done.
Resolving deltas: 100% (5609/5609), done.
Cloning into '/home/pi/openocd/tools/git2cl'...
remote: Counting objects: 64, done.       
remote: Total 64 (delta 0), reused 0 (delta 0)       
Cloning into '/home/pi/openocd/src/jtag/drivers/libjaylink'...
remote: Counting objects: 1004, done.       
remote: Total 1004 (delta 0), reused 0 (delta 0)       
Receiving objects: 100% (1004/1004), 236.74 KiB | 1.94 MiB/s, done.
Resolving deltas: 100% (767/767), done.
Submodule path 'jimtcl': checked out 'a9bf5975fd0f89974d689a2d9ebd0873c8d64787'
Submodule path 'src/jtag/drivers/libjaylink': checked out 'f73ad5e667ae8b26a52b847c603fdadaabf302a6'
Submodule path 'tools/git2cl': checked out '8373c9f74993e218a08819cbcdbab3f3564bbeba'
pi@raspberrypi:~ $ cd openocd
pi@raspberrypi:~/openocd $ sudo apt install make libtool libtool-bin pkg-config autoconf automake texinfo libusb-1.0 libusb-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libusb-1.0-0' for regex 'libusb-1.0'
Note, selecting 'libusb-1.0-0-dev' for regex 'libusb-1.0'
Note, selecting 'libusb-1.0-doc' for regex 'libusb-1.0'
libusb-1.0-0 is already the newest version (2:1.0.22-2).
libusb-1.0-0 set to manually installed.
make is already the newest version (4.2.1-1.2).
make set to manually installed.
pkg-config is already the newest version (0.29-6).
The following additional packages will be installed:
  autotools-dev libauthen-sasl-perl libdata-dump-perl libencode-locale-perl
  libfile-listing-perl libfont-afm-perl libhtml-form-perl libhtml-format-perl
  libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl
  libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl
  libhttp-message-perl libhttp-negotiate-perl libio-html-perl
  libio-socket-ssl-perl libltdl-dev liblwp-mediatypes-perl
  liblwp-protocol-https-perl libmailtools-perl libnet-http-perl
  libnet-smtp-ssl-perl libnet-ssleay-perl libsigsegv2 libtext-unidecode-perl
  libtimedate-perl libtry-tiny-perl liburi-perl libwww-perl
  libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl
  libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl
  libxml-sax-perl m4 perl-openssl-defaults tex-common
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc gettext libdigest-hmac-perl
  libgssapi-perl libtool-doc libcrypt-ssleay-perl gfortran
  | fortran95-compiler gcj-jdk libauthen-ntlm-perl libxml-sax-expatxs-perl
  m4-doc debhelper texlive-base texlive-latex-base texlive-generic-recommended
  texinfo-doc-nonfree texlive-fonts-recommended
The following NEW packages will be installed:
  autoconf automake autotools-dev libauthen-sasl-perl libdata-dump-perl
  libencode-locale-perl libfile-listing-perl libfont-afm-perl
  libhtml-form-perl libhtml-format-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl
  libhttp-daemon-perl libhttp-date-perl libhttp-message-perl
  libhttp-negotiate-perl libio-html-perl libio-socket-ssl-perl libltdl-dev
  liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl
  libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libsigsegv2
  libtext-unidecode-perl libtimedate-perl libtool libtool-bin libtry-tiny-perl
  liburi-perl libusb-1.0-0-dev libusb-1.0-doc libusb-dev libwww-perl
  libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl
  libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl
  libxml-sax-perl m4 perl-openssl-defaults tex-common texinfo
0 upgraded, 49 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,711 kB of archives.
After this operation, 25.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Abort.
pi@raspberrypi:~/openocd $


And then when I try to Root the toon :

Code: Select all
pi@raspberrypi:~ $ bash
pi@raspberrypi:~ $ sudo apt install python-serial python-cryptography
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-cryptography is already the newest version (2.6.1-3+deb10u2).
python-cryptography set to manually installed.
python-serial is already the newest version (3.4-4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ git clone https://github.com/martenjacobs/ToonRooter.git
Cloning into 'ToonRooter'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 200 (delta 7), reused 3 (delta 0), pack-reused 181
Receiving objects: 100% (200/200), 439.99 KiB | 1.30 MiB/s, done.
Resolving deltas: 100% (96/96), done.
pi@raspberrypi:~ $ cd ToonRooter
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
CRITICAL:__main__:[Errno 2] No such file or directory

pi@raspberrypi:~/ToonRooter $ --output-level DEBUG
bash: --output-level: command not found


I'm using a raspberry Pi 3 B+ with fresh installed Raspbian.


You did the install of OpenOCD wrong, look at this:

Code: Select all
git clone --recursive git://git.code.sf.net/p/openocd/code openocd
cd openocd
sudo apt install make libtool libtool-bin pkg-config autoconf automake texinfo libusb-1.0 libusb-dev
{
./bootstrap &&\
./configure --enable-sysfsgpio\
     --enable-bcm2835gpio \
     --prefix=/usr\
&&\
make -j4
} 2>&1 | tee openocd_build.log
sudo make install


Go to OpenOCD:

Code: Select all
cd openocd


Then run the following command (Use everything what here stand!):

Code: Select all
sudo apt install make libtool libtool-bin pkg-config autoconf automake texinfo libusb-1.0 libusb-dev
{
./bootstrap &&\
./configure --enable-sysfsgpio\
     --enable-bcm2835gpio \
     --prefix=/usr\
&&\
make -j4
} 2>&1 | tee openocd_build.log


And the run this command:

Code: Select all
sudo make install


Thanks for the response!

I've tried it your way but still without succes..

This is what I'm getting :

Code: Select all
pi@raspberrypi:~ $ cd openocd
pi@raspberrypi:~/openocd $ sudo apt install make libtool libtool-bin pkg-config autoconf automake texinfo libusb-1.0 libusb-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libusb-1.0-0' for regex 'libusb-1.0'
Note, selecting 'libusb-1.0-0-dev' for regex 'libusb-1.0'
Note, selecting 'libusb-1.0-doc' for regex 'libusb-1.0'
libusb-1.0-0 is already the newest version (2:1.0.22-2).
libusb-1.0-0 set to manually installed.
make is already the newest version (4.2.1-1.2).
make set to manually installed.
pkg-config is already the newest version (0.29-6).
The following additional packages will be installed:
  autotools-dev libauthen-sasl-perl libdata-dump-perl libencode-locale-perl
  libfile-listing-perl libfont-afm-perl libhtml-form-perl libhtml-format-perl
  libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl
  libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl
  libhttp-message-perl libhttp-negotiate-perl libio-html-perl
  libio-socket-ssl-perl libltdl-dev liblwp-mediatypes-perl
  liblwp-protocol-https-perl libmailtools-perl libnet-http-perl
  libnet-smtp-ssl-perl libnet-ssleay-perl libsigsegv2 libtext-unidecode-perl
  libtimedate-perl libtry-tiny-perl liburi-perl libwww-perl
  libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl
  libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl
  libxml-sax-perl m4 perl-openssl-defaults tex-common
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc gettext libdigest-hmac-perl
  libgssapi-perl libtool-doc libcrypt-ssleay-perl gfortran
  | fortran95-compiler gcj-jdk libauthen-ntlm-perl libxml-sax-expatxs-perl
  m4-doc debhelper texlive-base texlive-latex-base texlive-generic-recommended
  texinfo-doc-nonfree texlive-fonts-recommended
The following NEW packages will be installed:
  autoconf automake autotools-dev libauthen-sasl-perl libdata-dump-perl
  libencode-locale-perl libfile-listing-perl libfont-afm-perl
  libhtml-form-perl libhtml-format-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl
  libhttp-daemon-perl libhttp-date-perl libhttp-message-perl
  libhttp-negotiate-perl libio-html-perl libio-socket-ssl-perl libltdl-dev
  liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl
  libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libsigsegv2
  libtext-unidecode-perl libtimedate-perl libtool libtool-bin libtry-tiny-perl
  liburi-perl libusb-1.0-0-dev libusb-1.0-doc libusb-dev libwww-perl
  libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl
  libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl
  libxml-sax-perl m4 perl-openssl-defaults tex-common texinfo
0 upgraded, 49 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,711 kB of archives.
After this operation, 25.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] sudo make install
Abort.
pi@raspberrypi:~/openocd $
Floats
Starting Member
Starting Member
 
Posts: 2
Joined: February 2020

Re: Fully automated rooting script

Postby TheHogNL » Tue Feb 18, 2020 8:55 am

Just don't simply copy paste .. read and try to understand what you are doing.
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1502
Joined: August 2017

Re: Fully automated rooting script

Postby hmay » Sun May 03, 2020 9:54 am

I am trying to root a Toon with U-Boot version 2010.09-R10 but I am running into problems with OpenOCD.

I started with a clean install of stretch on a pi 3b, disabled the serial login shell and enabled the serial interface.
I also did a sudo apt-get update / upgrade.
I followed te readme of martenjacobs on GitHub exactly as writen including the OpenOCD install.

Then connected the Toon and ran the rooting script with the following output:

Code: Select all
pi@raspberrypi:~/ToonRooter$ 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__:{"uboot_only": false, "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 AAAAB3NzaC1yc2EAAAADAQABAAABAQDZnL1FMePQyxXTuIT9n868t6Mu04eO2o+JpgoLSlrY77cIGQiK+KqVsEvwJ5gFE8Xnnvk9KKAv1O4pUY06erwRJoqcLkPe7ioVth9HaJRmrRgJm4NUwjxZll/CaT5hUZb6RlGBKKqt+H2p05jNchuydV7KXtzLanRsUtDnLrppRsRcbOyYrXj+Xwklni7tqIbWMxxeG/i3SXdU9JhUmb5k54ZtA+5MXDyx0zQskCK2W6frgYMAkPtG/MFFl5isDMfyVjbT9OQm3vcGHEvr6LEmfKK63/baRCmVzHSTVZnJm790Lr4IcB5F1RopOkqC9Rc0D4ks3H+oZQ/zAcsfSPqH"}
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 211, 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
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 187, in <module>
    main()
  File "/home/pi/ToonRooter/__main__.py", line 183, in main
    rooter.Rooter(**params).run()
  File "./rooter.py", line 76, in run
    self.start_bootloader("assets/u-boot.bin")
  File "./rooter.py", line 231, in start_bootloader
    proc.terminate()
  File "/usr/lib/python2.7/subprocess.py", line 1248, in terminate
    self.send_signal(signal.SIGTERM)
  File "/usr/lib/python2.7/subprocess.py", line 1243, in send_signal
    os.kill(self.pid, sig)


I saw a similar issue in the thread which was solved by installing OpenOCD again.
I did another clean install but the issue remains the same.

If a start OpenOCD the I am getting the following output:

Code: Select all
pi@raspberrypi:~/openocd$ openocd
Open On-Chip Debugger 0.10.0+dev-01209-g8f2afaaf-dirty (2020-05-03-10:05)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
embedded:startup.tcl:26: Error: Can't find openocd.cfg
in procedure 'script'
at file "embedded:startup.tcl", line 26
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: Debug Adapter has to be specified, see "adapter driver" command
embedded:startup.tcl:26: Error:
in procedure 'script'
at file "embedded:startup.tcl", line 26


I am lost, what goes wrong?
Your help is much appreciated!
hmay
Starting Member
Starting Member
 
Posts: 5
Joined: May 2020

Re: Fully automated rooting script

Postby TheHogNL » Sun May 03, 2020 12:57 pm

hmay wrote:I am lost, what goes wrong?
Your help is much appreciated!


Your output suggest openocd isn't working but your test failed because you didn't start openocd with the command needed, try: sudo openocd -s /usr/share/openocd -f assets/adapters/rpi3.cfg -f assets/boards/ed20.cfg (from the ToonRooter directory)
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1502
Joined: August 2017

Re: Fully automated rooting script

Postby hmay » Sun May 03, 2020 1:09 pm

Thanks for the quick reply.

It appears that OpenOCD is missing an interface: bcm2835gpio.
However I did enter the
Code: Select all
    --enable-bcm2835gpio \
line.

Could it be related to the order in which I have installed the tools?
I started with ToonRooter and after that I installed the OpenOCD stuff.

Code: Select all
pi@raspberrypi:~/ToonRooter$  sudo openocd -s /usr/share/openocd -f assets/adapters/rpi3.cfg -f assets/boards/ed20.cfg
Open On-Chip Debugger 0.10.0+dev-01209-g8f2afaaf-dirty (2020-05-03-10:05)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter driver' not 'interface'
Error: The specified debug interface was not found (bcm2835gpio)
The following debug adapters are available:
1: ftdi
2: usb_blaster
3: ft232r
4: usbprog
5: jlink
6: vsllink
7: rlink
8: ulink
9: arm-jtag-ew
10: hla
11: osbdm
12: opendous
13: aice
14: xds110
15: st-link
hmay
Starting Member
Starting Member
 
Posts: 5
Joined: May 2020

Re: Fully automated rooting script

Postby TheHogNL » Sun May 03, 2020 3:09 pm

hmay wrote:It appears that OpenOCD is missing an interface: bcm2835gpio.
However I did enter the
Code: Select all
    --enable-bcm2835gpio \
line.

Could it be related to the order in which I have installed the tools?
I started with ToonRooter and after that I installed the OpenOCD stuff.


No that is not a problem.

Try recompiling openocd and try to figure out with the bcm2835gpio isn't added.
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1502
Joined: August 2017

Re: Fully automated rooting script

Postby hmay » Mon May 04, 2020 11:31 am

I finally got the OpenOCD software correctly installed.
I could not get it to work if I follow the instructions from the readme of martenjacobs on GitHub.
Instead I used the following commands for the install:

Code: Select all
git clone --recursive git://git.code.sf.net/p/openocd/code openocd
cd openocd
sudo apt install make libtool libtool-bin pkg-config autoconf automake texinfo libusb-1.0 libusb-dev
./bootstrap
./configure --enable-sysfsgpio --enable-bcm2835gpio --prefix=/usr
make -j4
sudo make install


The rooting script worked great and my Toon is set free!
Thanks for pointing me into the right direction.

By the way, the rooting script is a piece of art :D
hmay
Starting Member
Starting Member
 
Posts: 5
Joined: May 2020

Re: Fully automated rooting script

Postby TheHogNL » Mon May 04, 2020 12:12 pm

That is the same commands (only without the subfunction around it).
I'll update the README on the toonrooter TSC github page because I see often people not copy pasting this correctly :)
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1502
Joined: August 2017

Re: Fully automated rooting script

Postby EricvL » Wed May 06, 2020 3:11 pm

Hi guys,

I recently decided to root my Toon and I ordered a FTDI breakout like this:
Image
Originally I was planning to use the very well documented instructions from Dennis Bors website (https://www.dennisbor.com/2020/01/19/toon-rooten/), but I like the idea of using the ToonRooter script. I only find it very hard to find/understand the instructions when not using a PI. For instance, there are a lot of parameters to specify, but I don't know which are mandatory and which aren't.
I'm planning to boot my laptop and use a KALI distribution. Does that matter or will most Linux distros work?
Thanks for any help in advance!

Kind regards,
Eric
EricvL
Starting Member
Starting Member
 
Posts: 6
Joined: May 2020

Re: Fully automated rooting script

Postby TheHogNL » Wed May 06, 2020 9:16 pm

EricvL wrote:Hi guys,

I recently decided to root my Toon and I ordered a FTDI breakout like this:
Image
Originally I was planning to use the very well documented instructions from Dennis Bors website (https://www.dennisbor.com/2020/01/19/toon-rooten/), but I like the idea of using the ToonRooter script. I only find it very hard to find/understand the instructions when not using a PI. For instance, there are a lot of parameters to specify, but I don't know which are mandatory and which aren't.
I'm planning to boot my laptop and use a KALI distribution. Does that matter or will most Linux distros work?
Thanks for any help in advance!

Kind regards,
Eric


ToonRooter is a simple python script so install (if not already installed in kali) python and the necessary libraries (https://github.com/ToonSoftwareCollecti ... pendencies) and then run the python script (as mentioned in toonrooter readme). Nothing special here (nothing to do with a Pi).

Only thing is, if you happen to have a Toon with uboot R10 you need jtag connection and openocd installed (which the toonrooter will use then). And from that point, it is easier to use a Pi because it has jtag headers on it.

And about DennisBor site.. it is just a copy of the documentation which is on this forum for about 6 years now.
And it is old. It is wrong about a few parts (like, I don't recommend installing getty and busybox. And it is missing about providing a configured encrypted password).
Als DennisBor is mentioning (after update-rooted.sh -f ) to change some configs. But that is already done using the update script so that is unnecessary.
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1502
Joined: August 2017

Re: Fully automated rooting script

Postby EricvL » Thu May 07, 2020 8:32 am

Thank you very much again for your help, I appreciate it! I will give it a try and let you know the results.
EricvL
Starting Member
Starting Member
 
Posts: 6
Joined: May 2020

Re: Fully automated rooting script

Postby rickvnl » Tue May 26, 2020 12:50 pm

About two years ago I rooted my Toon 1 with this great script.
Since then I didn't update or so. Now I want to update but I can't remember my SSH login.
Are there default passwords?
Or can I reset the password?

Running sw version 4.19.10 now. So no option in the Toon to show the password.
rickvnl
Starting Member
Starting Member
 
Posts: 10
Joined: April 2018

Re: Fully automated rooting script

Postby TerrorSource » Tue May 26, 2020 1:28 pm

rickvnl wrote:About two years ago I rooted my Toon 1 with this great script.
Since then I didn't update or so. Now I want to update but I can't remember my SSH login.
Are there default passwords?
Or can I reset the password?

Running sw version 4.19.10 now. So no option in the Toon to show the password.


Depends on the way you rooted the toon at that time.
If you used ToonRooter it generated a random password while rooting.
If you did it by hand you can try "toon" as password.

If you dont remember the password, try re-rooting it with ToonRooter.
TerrorSource
Member
Member
 
Posts: 396
Joined: May 2017

Previous

Return to Toon Rooting

Who is online

Users browsing this forum: No registered users and 0 guests