Fully automated rooting script

Everything about rooting Toons 1 and 2.

Moderators: marcelr, Toonz, TheHogNL, TerrorSource

Re: Fully automated rooting script

Postby TheHogNL » Thu Apr 05, 2018 6:27 pm

rickvnl wrote:
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.


Check this post https://www.domoticaforum.eu/viewtopic. ... 999#p85842
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1685
Joined: August 2017

Re: Fully automated rooting script

Postby Martin101010 » Fri Apr 06, 2018 1:24 pm

Marten,

Any idea what is going wrong here? I use a rasberry Pi 3 with a clean and updated Raspbian Stretch.
When I set the boodstrap, Putty losses communication and the end. This is the last line from the log

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./src -I./src -I./src/helper -DPKGDATADIR=\"/usr/share/openocd\" -DBINDIR=\"/usr/bin\" -I./jimtcl -I./jimtcl -isystem /usr/include/libusb-1.0 -I./src/jtag/drivers/libjaylink/libjaylink -I./src/jtag/drivers/libjaylink -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -g -O2 -MT src/jtag/drivers/src_jtag_drivers_libocdjtagdrivers_la-driver.lo -MD -MP -MF src/jtag/drivers/.deps/src_jtag_drivers_libocdjtagdrivers_la-driver.Tpo -c src/jtag/drivers/driver.c -o src/jtag/drivers/src_jtag_drivers_libocdjtagdrivers_la-driver.o


When I try to Sudo make install I get

Code: Select all
pi@raspberrypi:~/openocd $ sudo make install
Makefile:4374: warning: overriding recipe for target 'check-recursive'
Makefile:3787: warning: ignoring old recipe for target 'check-recursive'
make  install-recursive
make[1]: Entering directory '/home/pi/openocd'
Makefile:4374: warning: overriding recipe for target 'check-recursive'
Makefile:3787: warning: ignoring old recipe for target 'check-recursive'
Making install in jimtcl
make[2]: Entering directory '/home/pi/openocd/jimtcl'
make[2]: Nothing to be done for 'install'.
make[2]: Leaving directory '/home/pi/openocd/jimtcl'
Making install in src/jtag/drivers/libjaylink
make[2]: Entering directory '/home/pi/openocd/src/jtag/drivers/libjaylink'
Making install in libjaylink
make[3]: Entering directory '/home/pi/openocd/src/jtag/drivers/libjaylink/libjaylink'
make[4]: Entering directory '/home/pi/openocd/src/jtag/drivers/libjaylink/libjaylink'
make[4]: Leaving directory '/home/pi/openocd/src/jtag/drivers/libjaylink/libjaylink'
make[3]: Leaving directory '/home/pi/openocd/src/jtag/drivers/libjaylink/libjaylink'
make[3]: Entering directory '/home/pi/openocd/src/jtag/drivers/libjaylink'
make[4]: Entering directory '/home/pi/openocd/src/jtag/drivers/libjaylink'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Leaving directory '/home/pi/openocd/src/jtag/drivers/libjaylink'
make[3]: Leaving directory '/home/pi/openocd/src/jtag/drivers/libjaylink'
make[2]: Leaving directory '/home/pi/openocd/src/jtag/drivers/libjaylink'
make[2]: Entering directory '/home/pi/openocd'
Makefile:4374: warning: overriding recipe for target 'check-recursive'
Makefile:3787: warning: ignoring old recipe for target 'check-recursive'
restore=: && backupdir=".am$$" && \
am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && \
rm -rf $backupdir && mkdir $backupdir && \
if (makeinfo --version) >/dev/null 2>&1; then \
  for f in doc/openocd.info doc/openocd.info-[0-9] doc/openocd.info-[0-9][0-9] doc/openocd.i[0-9] doc/openocd.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
cd "$am__cwd"; \
if makeinfo   -I doc -I ./doc \
-o doc/openocd.info ./doc/openocd.texi; \
then \
  rc=0; \
  CDPATH="${ZSH_VERSION+.}:" && cd .; \
else \
  rc=$?; \
  CDPATH="${ZSH_VERSION+.}:" && cd . && \
  $restore $backupdir/* `echo "./doc/openocd.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
/bin/bash ./libtool  --tag=CC   --mode=link gcc -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -g -O2   -o src/xsvf/libxsvf.la  src/xsvf/xsvf.lo  -ldl
libtool:   error: 'src/xsvf/xsvf.lo' is not a valid libtool object
Makefile:2494: recipe for target 'src/xsvf/libxsvf.la' failed
make[2]: *** [src/xsvf/libxsvf.la] Error 1
make[2]: Leaving directory '/home/pi/openocd'
Makefile:3787: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/pi/openocd'
Makefile:4086: recipe for target 'install' failed
make: *** [install] Error 2
pi@raspberrypi:~/openocd $


Wat is going wrong here?
Martin101010
Starting Member
Starting Member
 
Posts: 38
Joined: November 2017

Re: Fully automated rooting script

Postby rickvnl » Fri Apr 06, 2018 9:52 pm

Martin101010 wrote:Marten,

Any idea what is going wrong here? I use a rasberry Pi 3 with a clean and updated Raspbian Stretch.
When I set the boodstrap, Putty losses communication and the end. This is the last line from the log

*CUT*

Wat is going wrong here?


I ran into this problem yesterday. After an update of raspian (sudo apt-get update & sudo apt-get upgrade) if started execution the line of commands 1 by 1.

1.
Code: Select all
git clone --recursive git://git.code.sf.net/p/openocd/code openocd


2.
Code: Select all
cd openocd


3.
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 \
     --enable-maintainer-mode \
     --disable-werror \
     --enable-ft2232_libftdi \
     --enable-ep93xx \
     --enable-at91rm9200 \
     --enable-usbprog \
     --enable-presto_libftdi \
     --enable-jlink \
     --enable-vsllink \
     --enable-rlink \
     --enable-arm-jtag-ew \
     --enable-dummy \
     --enable-buspirate \
     --enable-ulink \
     --enable-presto_libftdi \
     --enable-usb_blaster_libftdi \
     --enable-ft2232_libftdi\
     --prefix=/usr\
&&\
make -j4
} 2>&1 | tee openocd_build.log


4.
Code: Select all
sudo make install


I don't know if this is the normal (and best) way to do but it worked for me afterall.

Now it's rooted... but no SSH access. Tried this post https://www.domoticaforum.eu/viewtopic. ... 999#p85842 but I don't know how to do this.
Please help me out.
rickvnl
Starting Member
Starting Member
 
Posts: 10
Joined: April 2018

Re: Fully automated rooting script

Postby Martin101010 » Sat Apr 07, 2018 3:09 pm

@ Rickvnl: I've tried that as well. Unfortunatly no luck. Same issue.
Martin101010
Starting Member
Starting Member
 
Posts: 38
Joined: November 2017

Re: Fully automated rooting script

Postby TheHogNL » Sat Apr 07, 2018 3:36 pm

rickvnl wrote:Now it's rooted... but no SSH access. Tried this post https://www.domoticaforum.eu/viewtopic. ... 999#p85842 but I don't know how to do this.
Please help me out.


If you used the default settings in the auto rooting script there is a public and private key in the same dir where the script is (id_rsa and id_rsa.pub). Just type "ssh -i id_rsa root@<TOON IP ADDRESS>" from that directory and you should be logged into the Toon
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1685
Joined: August 2017

Re: Fully automated rooting script

Postby rickvnl » Sun Apr 08, 2018 11:33 am

TheHogNL wrote:
rickvnl wrote:Now it's rooted... but no SSH access. Tried this post https://www.domoticaforum.eu/viewtopic. ... 999#p85842 but I don't know how to do this.
Please help me out.


If you used the default settings in the auto rooting script there is a public and private key in the same dir where the script is (id_rsa and id_rsa.pub). Just type "ssh -i id_rsa root@<TOON IP ADDRESS>" from that directory and you should be logged into the Toon


Code: Select all
ssh -i id_rsa root@192.168.0.131
The authenticity of host '192.168.0.131 (192.168.0.131)' can't be established.
RSA key fingerprint is SHA256:a7ctIYAi23eG78PshwgEKTqQ1KUjAONV90sVCTMA354.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.131' (RSA) to the list of known hosts.
root@192.168.0.131's password:
Permission denied, please try again.
rickvnl
Starting Member
Starting Member
 
Posts: 10
Joined: April 2018

Re: Fully automated rooting script

Postby TheHogNL » Sun Apr 08, 2018 7:31 pm

Ok then the key installing went wrong.
Try to follow the original rooting guide and check if you get get into your toon via that route.

Or maybe reusing the rooting script will work. I'm not familiar with that script enough.
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1685
Joined: August 2017

Re: Fully automated rooting script

Postby rickvnl » Sun Apr 08, 2018 9:11 pm

TheHogNL wrote:Ok then the key installing went wrong.
Try to follow the original rooting guide and check if you get get into your toon via that route.

Or maybe reusing the rooting script will work. I'm not familiar with that script enough.


Thnx! I deleted the whole folder ToonRooter. Rerun the root script and after that I immediately "ran ssh -i id_rsa root@<TOONIP> in the same terminal window on my Mac. Worked liked a charm!
Now I just need to find out how to gain SSH access on a second machine. :)
rickvnl
Starting Member
Starting Member
 
Posts: 10
Joined: April 2018

Re: Fully automated rooting script

Postby TheHogNL » Mon Apr 09, 2018 7:32 am

When you are in you can change the password and use that.
Also, you can copy the rsa files and use them there. Remember that your private key (the one without .pub) is ... private ... don't share it with others just like your password.
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1685
Joined: August 2017

Re: Fully automated rooting script

Postby newwolf » Mon Apr 09, 2018 10:30 pm

Hey, I don't know what to do about this.
Allready rebuild the OS en recabled it, but same problem.

Could you please help me?

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
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-R10
ERROR:rooter:Unable to log in using password (need JTAG, but it's disabled)
newwolf
Starting Member
Starting Member
 
Posts: 39
Joined: August 2012

Re: Fully automated rooting script

Postby TheHogNL » Tue Apr 10, 2018 2:41 pm

Somehow loading the patched u-boot doesn't work. After the loading of the new image into RAM it restarts the Toon but it comes back with the same (wrong) u-boot version.

Try to follow the openocd steps from the original rooting guide to load the patched u-boot version and check why that is failing.

Maybe the file "assets/u-boot.bin" is missing? Did you forget to download that from github?
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1685
Joined: August 2017

Re: Fully automated rooting script

Postby newwolf » Tue Apr 10, 2018 4:30 pm

Just started the script with debug to see what's the problem, but also nothing I understand.

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
Failed to halt CPU after 1 sec
>
DEBUG:rooter:reset halt
JTAG scan chain interrogation failed: all zeroes
Check JTAG interface, timings, target power, etc.
Trying to use configured scan chain anyway...
imx27.etb: IR capture error; saw 0x00 not 0x01
Bypassing JTAG setup events due to errors
srst pulls trst - can not reset into halted mode. Issuing halt after reset.
timed out while waiting for target halted
TARGET: imx27.cpu - Not halted
in procedure 'reset'
in procedure 'ocd_bouncer'


>
INFO:rooter:Loading new image to RAM
DEBUG:roote>
INFO:rooter:Starting up new image
INFO:rooter:Waiting for Toon to restart
INFO:rooter:Toon has U-Boot version 2010.09-R10
ERROR:rooter:Unable to log in using password (need JTAG, but it's disabled)


Will try this evening the manual version.
newwolf
Starting Member
Starting Member
 
Posts: 39
Joined: August 2012

Re: Fully automated rooting script

Postby marcelr » Tue Apr 10, 2018 6:20 pm

It's probably this one: please check the wiring of the JTAG interface to Toon, and the prower supply.

newwolf wrote:DEBUG:rooter:reset halt
JTAG scan chain interrogation failed: all zeroes
Check JTAG interface, timings, target power, etc.


good luck.
marcelr
Global Moderator
Global Moderator
 
Posts: 1149
Joined: May 2012
Location: Ehv

Re: Fully automated rooting script

Postby newwolf » Tue Apr 10, 2018 6:40 pm

Thanks,

After, some searching I ended here:
https://www.domoticaforum.eu/viewtopic. ... 195#p83621

Replaced his cfg files (including changes) over the original cfg files and the magic started.

Now I have to find a way to get rid of the activatie wizard etc.

Thanks for all
newwolf
Starting Member
Starting Member
 
Posts: 39
Joined: August 2012

Re: Fully automated rooting script

Postby martenjacobs » Tue Apr 10, 2018 7:42 pm

@newwolf, @marcelr is probably right. Currently, the script assumes every step is successful, so it just hangs.
martenjacobs
Member
Member
 
Posts: 52
Joined: March 2018

PreviousNext

Return to Toon Rooting

Who is online

Users browsing this forum: No registered users and 1 guest