Fully automated rooting script

Everything about rooting Toons 1 and 2.

Moderator: marcelr

Re: Fully automated rooting script

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

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


You're probably not in the correct folder. id_rsa is a key file generated by the rooting script into the current working directory. If you open a new terminal and it's in a different directory ssh will not be able to find it.
martenjacobs
Starting Member
Starting Member
 
Posts: 27
Joined: March 2018

Re: Fully automated rooting script

Postby Martin101010 » Mon Apr 16, 2018 3:54 pm

@ Marten: When I do a sudo make install I get the following error. Do you have an idea what is wrong?

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'
cc -Wall  -I. -g -O2 -fno-unwind-tables -fno-asynchronous-unwind-tables  -rdynamic  -o jimsh jimsh.o initjimsh.o libjim.a -ldl
jimsh.o: In function `main':
/home/pi/openocd/jimtcl/jimsh.c:106: undefined reference to `Jim_InitStaticExtensions'
/home/pi/openocd/jimtcl/jimsh.c:106: undefined reference to `Jim_InitStaticExtensions'
/home/pi/openocd/jimtcl/jimsh.c:121: undefined reference to `Jim_InteractivePrompt'
initjimsh.o: In function `Jim_initjimshInit':
/home/pi/openocd/jimtcl/_initjimsh.c:5: undefined reference to `Jim_PackageProvide'
libjim.a(jim.o): In function `JimEscape':
/home/pi/openocd/jimtcl/jim.c:1905: undefined reference to `utf8_fromunicode'
libjim.a(jim.o): In function `JimCommandMatch':
/home/pi/openocd/jimtcl/jim.c:11446: undefined reference to `Jim_AioFilehandle'
libjim.a(jim.o): In function `Jim_FormatCoreCommand':
/home/pi/openocd/jimtcl/jim.c:15011: undefined reference to `Jim_FormatString'
collect2: error: ld returned 1 exit status
Makefile:52: recipe for target 'jimsh' failed
make[2]: *** [jimsh] Error 1
make[2]: Leaving directory '/home/pi/openocd/jimtcl'
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 $
Martin101010
Starting Member
Starting Member
 
Posts: 38
Joined: November 2017

Re: Fully automated rooting script

Postby martenjacobs » Mon Apr 16, 2018 6:34 pm

Martin101010 wrote:@ Marten: When I do a sudo make install I get the following error. Do you have an idea what is wrong?

Code: Select all
...


Not really, I'm no expert on OpenOCD at all. I'm thinking though, maybe it's better to clone the v0.10.0 branch of OpenOCD, as it's unlikely that it'll change in the future.
Could you try switching to the v0.10.0 tag and build it again? If this works I'll change the documentation on GitHub

Code: Select all
cd ~/openocd
git reset --hard
git checkout tags/v0.10.0


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
sudo make install
martenjacobs
Starting Member
Starting Member
 
Posts: 27
Joined: March 2018

Re: Fully automated rooting script

Postby mAiden » Mon Apr 16, 2018 7:58 pm

Martin101010 wrote:@ Marten: When I do a sudo make install I get the following error. Do you have an idea what is wrong?

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'
cc -Wall  -I. -g -O2 -fno-unwind-tables -fno-asynchronous-unwind-tables  -rdynamic  -o jimsh jimsh.o initjimsh.o libjim.a -ldl
jimsh.o: In function `main':
/home/pi/openocd/jimtcl/jimsh.c:106: undefined reference to `Jim_InitStaticExtensions'
/home/pi/openocd/jimtcl/jimsh.c:106: undefined reference to `Jim_InitStaticExtensions'
/home/pi/openocd/jimtcl/jimsh.c:121: undefined reference to `Jim_InteractivePrompt'
initjimsh.o: In function `Jim_initjimshInit':
/home/pi/openocd/jimtcl/_initjimsh.c:5: undefined reference to `Jim_PackageProvide'
libjim.a(jim.o): In function `JimEscape':
/home/pi/openocd/jimtcl/jim.c:1905: undefined reference to `utf8_fromunicode'
libjim.a(jim.o): In function `JimCommandMatch':
/home/pi/openocd/jimtcl/jim.c:11446: undefined reference to `Jim_AioFilehandle'
libjim.a(jim.o): In function `Jim_FormatCoreCommand':
/home/pi/openocd/jimtcl/jim.c:15011: undefined reference to `Jim_FormatString'
collect2: error: ld returned 1 exit status
Makefile:52: recipe for target 'jimsh' failed
make[2]: *** [jimsh] Error 1
make[2]: Leaving directory '/home/pi/openocd/jimtcl'
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 $


Try make before you do make install.
mAiden
Member
Member
 
Posts: 72
Joined: July 2017

Re: Fully automated rooting script

Postby marcelr » Mon Apr 16, 2018 10:28 pm

Hmmm ... It looks like the linker cannot find the library holding a bunch of objects (the undefined references).

Which version of openocd are you using?
You could try the suggestion of mAiden, but if the makefile is any good, make install should depend on make (all), so all stuff that needs to be installed should be built anyway.

I'm not sure why you try to build code for all JTAG adapters, since you will use only one: the bcm2835gpio, on the raspberry. Maybe by toning the requests for all interfaces a bit down, you can bypass the error. I never needed the jimtcl code (not even sure what it is).
marcelr
Advanced Member
Advanced Member
 
Posts: 925
Joined: May 2012
Location: Ehv

Re: Fully automated rooting script

Postby martenjacobs » Tue Apr 17, 2018 5:53 am

marcelr wrote:(...)
I'm not sure why you try to build code for all JTAG adapters, since you will use only one: the bcm2835gpio, on the raspberry. Maybe by toning the requests for all interfaces a bit down, you can bypass the error. I never needed the jimtcl code (not even sure what it is).


True, I just broadly copy-pasted the instructions posted here, and didn't give much thought to the flags in there. However, I do think the jimtcl component is required, as it's related to the Tcl programming language, in which (at least) part of OpenOCD is written.

I don't have a Pi on hand now, but I just successfully installed OpenOCD with the following commands on a VM (which is x64-based):
Code: Select all
git clone --recursive git://git.code.sf.net/p/openocd/code openocd
cd openocd
git checkout tags/v0.10.0
sudo apt install make libtool libtool-bin pkg-config autoconf automake texinfo libusb-1.0 libusb-dev
./bootstrap
./configure --enable-bcm2835gpio --prefix=/usr
make -j4 | tee openocd_build.log
sudo make install


If someone could confirm this works on a (somewhat clean) Raspbian install I'll change the documentation on GitHub.
martenjacobs
Starting Member
Starting Member
 
Posts: 27
Joined: March 2018

Re: Fully automated rooting script

Postby Martin101010 » Fri Apr 20, 2018 7:19 am

Marten,

Tried it, but no succes. Then I followed the steps written here:

cdn-learn.adafruit.com/downloads/pdf/pr ... rry-pi.pdf

I see not much differance but it works :-)

Thanks for pointing me in the right direction.
Martin101010
Starting Member
Starting Member
 
Posts: 38
Joined: November 2017

Re: Fully automated rooting script

Postby martenjacobs » Fri Apr 20, 2018 8:58 am

Martin101010 wrote:Marten,

Tried it, but no succes. Then I followed the steps written here:

cdn-learn.adafruit.com/downloads/pdf/pr ... rry-pi.pdf

I see not much differance but it works :-)

Thanks for pointing me in the right direction.


That's weird... The only difference I see is the instructions in my repo use --prefix=/usr while those instructions don't. I'm not really sure what that parameter does, so I'm a bit reluctant to remove it... Anyway, I'm glad you were able to get it working.
martenjacobs
Starting Member
Starting Member
 
Posts: 27
Joined: March 2018

Re: Fully automated rooting script

Postby mAiden » Sun Apr 29, 2018 8:51 am

No idea if it will work. But I give it a chance.
Everything installed for automatic Toon rooten, only thing I have yet to find out is, or on an OrangePI (have no other anymore.), how disable serial console and enable serial port on Armbian.

I'm going to try it with this cable.

https://nl.aliexpress.com/item/1pcs-lot ... 0.0.BLnmEo
mAiden
Member
Member
 
Posts: 72
Joined: July 2017

Re: Fully automated rooting script

Postby marcelr » Sun Apr 29, 2018 9:30 am

That's a 5V device. Toon has 3.3V logic, so there's a chance some parts may get fried as you go (notably the processor UARTs).
marcelr
Advanced Member
Advanced Member
 
Posts: 925
Joined: May 2012
Location: Ehv

Re: Fully automated rooting script

Postby mAiden » Sun Apr 29, 2018 9:41 am

marcelr wrote:That's a 5V device. Toon has 3.3V logic, so there's a chance some parts may get fried as you go (notably the processor UARTs).


Dont like that, thanks for the warning Marcel.
Then i need to wait to this one will arrive:

https://nl.aliexpress.com/item/5PCS-USB ... 0.0.cjXhdw
mAiden
Member
Member
 
Posts: 72
Joined: July 2017

Re: Fully automated rooting script

Postby marcelr » Sun Apr 29, 2018 10:24 am

That should work. At a bargain price, BTW.

EDIT:

An OrangePi comes with a built-in serial port (At least the one that I have). Can't you use that for rooting?
marcelr
Advanced Member
Advanced Member
 
Posts: 925
Joined: May 2012
Location: Ehv

Re: Fully automated rooting script

Postby mAiden » Sun Apr 29, 2018 10:30 am

marcelr wrote:That should work. At a bargain price, BTW.


Yes, for sure.. I'll let you know if its arrive, if my Toon is Rooted.
mAiden
Member
Member
 
Posts: 72
Joined: July 2017

Re: Fully automated rooting script

Postby mAiden » Sun Apr 29, 2018 10:42 am

marcelr wrote:An OrangePi comes with a built-in serial port (At least the one that I have). Can't you use that for rooting?


Got 2 OrangePi's Marcel.

OrangePI One and Oranje Pi PC SET3

Which do you have?
mAiden
Member
Member
 
Posts: 72
Joined: July 2017

Re: Fully automated rooting script

Postby marcelr » Sun Apr 29, 2018 12:15 pm

zero plus 2 H5
marcelr
Advanced Member
Advanced Member
 
Posts: 925
Joined: May 2012
Location: Ehv

PreviousNext

Return to Toon Rooting

Who is online

Users browsing this forum: No registered users and 1 guest