Page 2 of 30

Re: Fully automated rooting script

Posted: Thu Mar 22, 2018 10:34 am
by Toonz
Nice cable, I guess there is a market for it... :)

Re: Fully automated rooting script

Posted: Thu Mar 22, 2018 10:52 pm
by TheHogNL
Like that cable also! Nice job.

Couldn't we build a getty outside of busybox (maybe 'agetty') and put that in inittab as the getty for rooted Toons? By doing this we never touch the native busybox so we can't break other important stuff. If we have the agetty there would be no reason anymore to not add it to the the script.

Re: Fully automated rooting script

Posted: Thu Mar 22, 2018 11:11 pm
by marcelr
The custom busybox doesn't break anything. If you are really worried about installation failures, you can always back-up the original busybox and then install the new one. After successful completion of the installation, just remove the backup.

Re: Fully automated rooting script

Posted: Fri Mar 23, 2018 8:55 am
by TheHogNL
It is not the custom busybox but the possible cause that during the installation of the custom busybox some important files are lost during a power failure or unforseen reboot.

However, the possibility of this to happen is not that high. And Eneco also updates the busybox somewhere in 4.10 (could be earlier) and that didn't result in a lot of broken Toon also (we don't know the figures, but there is no mention about that in the Eneco forum). So installing the custom busybox using a script with opkg should be no problem. All busybox related issue's in this forum where caused by users making a error during thet ascii-transfer or trying to manually overwrite the buybox binary.

When I have some more time I'm also adding some installations of important packages in the update-script. Installing the custom busybox is one of them along with toonstore update.

Re: Fully automated rooting script

Posted: Fri Mar 23, 2018 9:43 am
by marcelr
That's a non-issue. As said earlier, just back-up your busybox:

Code: Select all

cp /bin/busybox /bin/busybox-1.27.2-r1
and do the install. If that fails you can repair by reinstating busybox:

Code: Select all

/bin/busybox-1.27.2-r1 cp /bin/busybox-1.27.2-r1 /bin/busybox
and you're good to go again for the next try.

Re: Fully automated rooting script

Posted: Fri Mar 23, 2018 11:07 am
by Rudolf
As an alternative the script could copy the fixed busybox and create symlinks for just the missing applets.

Re: Fully automated rooting script

Posted: Sun Mar 25, 2018 1:29 pm
by martenjacobs
@Rudolf that could be a nice compromise. I'll see if I find the time to script that somewhere in the coming weeks. If someone else has some time, I'm open to pull requests :D

Re: Fully automated rooting script

Posted: Tue Mar 27, 2018 5:36 pm
by TheHogNL
Tried your script, but without using the PI's connectors. I was using a usb serial device (/dev/ttyUSB0).
With the extra command --serial /dev/ttyUSB0 it didn't detect the toon (while rebooting the toon).

I didn't take much time to figure out why. Just used 'screen /dev/ttyS0 115200' to connect to the toon and root it myself. Just as fast for me as this toon didn't need JTAG.

But maybe you can look into this. If it should have worked, don't take too much time. Probably my mistake then :)

Re: Fully automated rooting script

Posted: Tue Mar 27, 2018 7:22 pm
by marcelr
Rudolf wrote:As an alternative the script could copy the fixed busybox and create symlinks for just the missing applets.
The links are only removed at the far end of the install. If it fails, they will stay as they are.

Re: Fully automated rooting script

Posted: Tue Mar 27, 2018 8:09 pm
by martenjacobs
TheHogNL wrote:Tried your script, but without using the PI's connectors. I was using a usb serial device (/dev/ttyUSB0).
With the extra command --serial /dev/ttyUSB0 it didn't detect the toon (while rebooting the toon).

I didn't take much time to figure out why. Just used 'screen /dev/ttyS0 115200' to connect to the toon and root it myself. Just as fast for me as this toon didn't need JTAG.

But maybe you can look into this. If it should have worked, don't take too much time. Probably my mistake then :)
The correct argument is --serial-port

Re: Fully automated rooting script

Posted: Wed Mar 28, 2018 12:46 pm
by TheHogNL
martenjacobs wrote: The correct argument is --serial-port
Pretty sure I did that (after reading the help) but i'll check tonight :)

Re: Fully automated rooting script

Posted: Thu Apr 05, 2018 1:24 am
by rickvnl
I ran the script tonight but got an error.

Code: Select all

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
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 91, in <module>
    boot_only = boot_only)
  File "./rooter.py", line 22, in root
    do_root(port, ssh_pubkey_data, has_jtag, check_uboot, cleanup_payload, reboot_after, boot_only)
  File "./rooter.py", line 52, in do_root
    start_bootloader("assets/u-boot.bin")
  File "./rooter.py", line 177, in start_bootloader
    ], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
Can someone tell me what I'm doing wrong? Thank you for a reply and for the great work!

Re: Fully automated rooting script

Posted: Thu Apr 05, 2018 9:52 am
by TheHogNL
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

Re: Fully automated rooting script

Posted: Thu Apr 05, 2018 3:05 pm
by rickvnl
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
Yes, I just followed the readme but I constanly get this error

Re: Fully automated rooting script

Posted: Thu Apr 05, 2018 4:56 pm
by rickvnl
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.