Fully automated rooting script

Everything about rooting Toons 1 and 2.

Moderators: marcelr, TheHogNL, Toonz

Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Fully automated rooting script

Post by Toonz »

Nice cable, I guess there is a market for it... :)
member of the Toon Software Collective
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post 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.
Member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Fully automated rooting script

Post 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.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post 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.
Member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Fully automated rooting script

Post 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.
Rudolf
Member
Member
Posts: 136
Joined: Mon Dec 04, 2017 8:50 pm

Re: Fully automated rooting script

Post by Rudolf »

As an alternative the script could copy the fixed busybox and create symlinks for just the missing applets.
martenjacobs
Member
Member
Posts: 53
Joined: Fri Mar 09, 2018 4:13 pm

Re: Fully automated rooting script

Post 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
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post 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 :)
Member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Fully automated rooting script

Post 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.
martenjacobs
Member
Member
Posts: 53
Joined: Fri Mar 09, 2018 4:13 pm

Re: Fully automated rooting script

Post 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
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post by TheHogNL »

martenjacobs wrote: The correct argument is --serial-port
Pretty sure I did that (after reading the help) but i'll check tonight :)
Member of the Toon Software Collective
rickvnl
Starting Member
Starting Member
Posts: 10
Joined: Thu Apr 05, 2018 1:20 am

Re: Fully automated rooting script

Post 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!
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post 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
Member of the Toon Software Collective
rickvnl
Starting Member
Starting Member
Posts: 10
Joined: Thu Apr 05, 2018 1:20 am

Re: Fully automated rooting script

Post 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
rickvnl
Starting Member
Starting Member
Posts: 10
Joined: Thu Apr 05, 2018 1:20 am

Re: Fully automated rooting script

Post 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.
Post Reply

Return to “Toon Rooting”