Giter Club home page Giter Club logo

toonrooter's Introduction

ToonRooter

What it does

This application roots your Toon from a Raspberry Pi or another device with a JTAG debugger attached.

At the moment, the following is implemented:

  • Detection of the U-Boot version
  • Loading of modified U-Boot version using JTAG
  • Logging in to supported versions of U-Boot
  • Setting up the U-Boot environment so the Toon boots into a serial console
  • Install and set up dropbear and sftp-server to let root user log in using an ssh key
  • Modify the firewall settings to enable remote access to ssh and http server
  • Generate SSH keys or let the user supply their own

What it might do in the more distant future

  • Check the output from a few commands so we know if we're successful...
  • More fine-grained control of the installation package

How safe is it?

I don't know.

You'll probably be fine. We're not overwriting the bootloader or important parts of the OS, so I don't see it really breaking anything, but you should make sure all wires are connected correctly, because otherwise you might short out something and break your Pi, Toon or both. If you are having issues with your Toon, run this application again with the --boot-only flag set. When it's finished you should be able to access a serial console on the Toon and check out what's wrong. To find some 'usual suspects', look through payload/patch_toon.sh, which is the script that's actually run on the Toon to enable SSH access. The rest of the application basically just opens an injection vector to make that possible.

I have a Toon 2

The new Toon 2 isn't rootable using this tool. There are just a few people who can help you root a toon 2. You can take a look at this forum post if you want to have your Toon 2 rooted: https://www.domoticaforum.eu/viewtopic.php?f=101&t=12162

How to use it?

Make sure there's no power going in to either of the devices, and double check the connections before powering up again. Connect your Toon's debugging header to a Raspberry Pi according to the following pin assignments:

Toon Signal Pi
1 RTCK
2 TRST 24
3 GND 25
4 TCK 23
5 GND 20
6 TMS 22
7 SRST 18
8 TDI 19
9 Vt
10 TDO 21
11 RxD 8
12
13 TxD 10
14 GND 9

If you don't know which pins on the Pi are which, see pinout.xyz. The pins on the Toon are numbered similarly to the Pi, starting at the one marked as 1.

Check if you're running Raspbian Stretch or later. You can check this by running cat /etc/issue, the response should be Raspbian GNU/Linux 9 \n \l or later. Then make sure the serial port on the Pi is enabled and the serial console is disabled using sudo raspi-config and reboot if necessary. Install the dependencies mentioned in the Dependencies-section.

Then get and run this application:

sudo apt install python-serial python-cryptography
git clone https://github.com/martenjacobs/ToonRooter.git
cd ToonRooter
sudo python . --jtag-available

Then reset your Toon and let the magic happen :)

Logging in to the Toon after rooting

During the rooting process, the script will generate a random root password and output it to the console. It will also generate an ssh private key. You can use either to log in to the Toon after it is rooted. The script does not use a generic default password for all Toons because it's considered a security hazard (and there's no easy way to change the password on the Toon itself).

The most secure way of logging in is using the SSH private key (even better if you encrypted the key using the --private-key-password argument).

After rooting, a file called id_rsa should be present in your working directory (or something else if you used --output-ssh-key). Logging in to the Toon can then be done by running:

ssh -i id_rsa root@[TOON IP]

If you used the --private-key-password argument, you will now be asked to insert the password you provided there. If you didn't, it should log in without asking for a password at all.

In the latter case, please consider encrypting it later using the following command:

ssh-keygen -p -f id_rsa

If for some reason you lost both the ssh private key and the password, you'll have to re-root your Toon.

It's not working!

Please re-check your wiring. If you're sure the wiring is correct, try the command with the --output-level DEBUG flag set and head over to this friendly forum where the issue has most likely already been solved. If not, post a reply and the active community will probably help you out.

But I don't have a Pi

You should definitely get a Pi.

However, if you're adamant that you want to root your Toon from another device and you have a JTAG debugger lying around that works with OpenOCD, you should be able to use this script without issue. Just put the configuration file for your debugger in the assets/adapters directory (make sure it has a .cfg extension) and pass the name of the file (without extension) to the script using the --jtag-hardware argument. I'm pretty sure Windows is not going to work though, so you should use a Linux (virtual) machine.

Command line arguments

usage: sudo python . [-h] [--serial-port PATH] [--ssh-public-key PATH]
                  [--output-ssh-key PATH] [--private-key-password PASSWORD]
                  [--output-level INFO|DEBUG] [--jtag-available]
                  [--dont-check-uboot] [--dont-cleanup-payload]
                  [--dont-reboot-after] [--boot-only]

Root your Toon.

optional arguments:
  -h, --help            show this help message and exit
  --serial-port PATH    The path of the serial port to use
  --ssh-public-key PATH
                        The path to an RSA public key which should be an
                        allowed key on the Toon after rooting it. If not
                        supplied, a key pair is generated
  --output-ssh-key PATH
                        The path to output a generated key pair (the public
                        key will have a .pub suffix). Default is to write
                        id_rsa and id_rsa.pub in the current directory.
                        Ignored if you've used --ssh-public-key
  --private-key-password PASSWORD
                        The password that should be used to encrypt the
                        private key when it's generated. Default is to use no
                        encryption. Ignored if you've used --ssh-public-key
  --output-level INFO|DEBUG
                        The level of output to print to the console
  --jtag-available      Indicates you have a JTAG debugger connected to your
                        Toon's JTAG headers
  --jtag-hardware TYPE  The JTAG debugger type that we're working with. The
                        default is to autodetect the JTAG debugger (which
                        currently only works on Raspberry Pi). Supported
                        values are: auto, rpi1, rpi2, rpi3
  --dont-check-uboot    Don't check whether we can access the installer
                        version of U-Boot before using JTAG to start up the
                        custom one.
  --dont-cleanup-payload
                        Leave the payload in /payload. Use this if you want to
                        include more files and do something with them.
  --dont-reboot-after   Don't reboot the Toon after rooting it. Use this if
                        you want to use the serial console after rooting
  --uboot-only          Only boot to the u-boot environment for manual control
  --boot-only           Don't install the payload, just boot into the serial
                        console

Dependencies

  • Raspbian Stretch (or later) if you're using a Pi
  • Python 2.7
  • pySerial 3.4 (or later)
  • OpenOCD from git (for newer Toons) (see instructions)

Install OpenOCD

If your Toon has a newer U-Boot version than 2010-R8, a JTAG interface is required to upload a bootloader that we have access to through the serial console. To do this, you need to build a version of OpenOCD (at the time of writing the version in apt doesn't support using the Pi's headers as JTAG debugger).

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

these instructions were based on the instructions posted here by rboers

Thanks

This application is based on instructions and software written by:

toonrooter's People

Contributors

igorybema avatar martenjacobs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toonrooter's Issues

Ready made package to load ?

Would be an idea to create ready made image ?
with for example:
https://github.com/RPi-Distro/pi-gen
I have never done it before but could have a go.

Or are there licensing concerns ?

Also does this only require the jtag wiring?
Sorry for asking but there are so many guides atm when searching its hard to find a good visual guide on what to connect the unix stuff i can do with 2 vingers in my nose :P

Get stuck , please help

Hoi hoi, ik heb serieus alles al geprobeerd en ook al 5x de pi opnieuw geinstalleerd etc.

@martenjacobs
Toon 1 - 2010.09-R8

toon ip op netwerk 192.168.40.146 bedraad op netwerk met internet
pi3+ ip op netwerk 192.168.40.205 bedraad op netwerk met internet

pi3+ Buster met alles geinstalleerd zoals aangegeven.
raspi-config enkel alleen P6 gevonden (serial Port enable)

  • would you like a login shell to be accessible over serial : no
  • would you like the serial port hardware to be enable: yes
    in config ook de "dtoverlay=disable-bt" gedaan om zeker te zijn dat de BT ook niet actief is.
image image

Ik krijg enkel alleen deze melding en dan houd het op.......

image

Wat doe ik fout, ik word crazy!

Rpi4 cfg file

Could someone have a look at a raspi4 cfg file? Tried the script using a pi4 but without succes. Would like to root my Toon, but only have a raspi4 :)!

Thanks!
Br,
Bart

Updated install command, replace libtool with libtool-bin

Hi Marten,
Great tool during install i had to change the libtool package to libtool-bin.
I used it on the following fresh image and did first update/upgared + reboot: 2018-03-13-raspbian-stretch.img
So if its not only me can you update the instlall notes ?

sudo apt-get install libtool-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
autotools-dev libltdl-dev libtool
Suggested packages:
libtool-doc autoconf automaken gfortran | fortran95-compiler gcj-jdk
The following NEW packages will be installed:
autotools-dev libltdl-dev libtool libtool-bin
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,207 kB of archives.
After this operation, 3,071 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirror.nl.leaseweb.net/raspbian/raspbian stretch/main armhf autotools-dev all 20161112.1 [73.4 kB]
Get:2 http://mirror.nl.leaseweb.net/raspbian/raspbian stretch/main armhf libltdl-dev armhf 2.4.6-2 [159 kB]
Get:3 http://mirror.nl.leaseweb.net/raspbian/raspbian stretch/main armhf libtool all 2.4.6-2 [545 kB]
Get:4 http://mirror.nl.leaseweb.net/raspbian/raspbian stretch/main armhf libtool-bin armhf 2.4.6-2 [430 kB]
Fetched 1,207 kB in 0s (1,810 kB/s)
Selecting previously unselected package autotools-dev.
(Reading database ... 124697 files and directories currently installed.)
Preparing to unpack .../autotools-dev_20161112.1_all.deb ...
Unpacking autotools-dev (20161112.1) ...
Selecting previously unselected package libltdl-dev:armhf.
Preparing to unpack .../libltdl-dev_2.4.6-2_armhf.deb ...
Unpacking libltdl-dev:armhf (2.4.6-2) ...
Selecting previously unselected package libtool.
Preparing to unpack .../libtool_2.4.6-2_all.deb ...
Unpacking libtool (2.4.6-2) ...
Selecting previously unselected package libtool-bin.
Preparing to unpack .../libtool-bin_2.4.6-2_armhf.deb ...
Unpacking libtool-bin (2.4.6-2) ...
Setting up libltdl-dev:armhf (2.4.6-2) ...
Setting up autotools-dev (20161112.1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libtool (2.4.6-2) ...
Setting up libtool-bin (2.4.6-2) ...
pi@raspberrypi:~/openocd $

Password?

Hello Marten,

After following this:

> Then get and run this application:

> sudo apt install python-serial python-cryptography
> git clone https://github.com/martenjacobs/ToonRooter.git
> cd ToonRooter
> sudo python . --jtag-available

> Then reset your Toon and let the magic happen :)

I connected the Toon via Wifi, and did SSH root@ip-address.
Then password is asked. I tried:

f4E9J
3BHf2
toon
Toon

But none works. In what did you ToonRooter changed the password?

Thank you, Pieter

Root password not overwritten after first root

It seems the randomly generated root password is only ever written to /etc/passwd when the Toon is first rooted. On subsequent 'rootings' it leaves the first one. Perhaps adding a 'force overwrite password' argument is a good idea.

Can't SSH

I've succesfully run the commands as listed in the README.md but I can't seem to ssh into the Toon
This is my output:

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-R8
INFO:rooter:Using password to log in
INFO:rooter:Logging in to U-Boot
INFO:rooter:Patching U-Boot
INFO:rooter:Waiting for boot up
INFO:rooter:Transferring payload
^CTraceback (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 43, in do_root
    write_payload(port, ssh_pubkey_data)
  File "./rooter.py", line 135, in write_payload
    base64.encode(f, port)
  File "/usr/lib/python2.7/base64.py", line 304, in encode
    output.write(line)
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 542, in write
    abort, ready, _ = select.select([self.pipe_abort_write_r], [self.fd], [], None)
KeyboardInterrupt
pi@rpi3:~/ToonRooter $ sudo python . --output-level DEBUG --jtag-available
INFO:__main__:Starting up...
INFO:__main__:Written private and public key pair to ./id_rsa and ./id_rsa.pub, respectively
DEBUG:__main__:{"cleanup_payload": true, "ssh_pubkey_data": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDnr75IshABuapLqZbLZtkrWIYfmr0waGYOQwsUF7/Fnrh0QY9v7e+E9O+AIH1E7nMOcY0J51rU90octa1l2fjC7AWxVex9rswig2zYVpjt+acSk7MDbqsBg6jvSvsEvC/JB0+g2fNLDXhCITK7WrWCVMX92hu4MoVEKPJOoFpsVoLBhpLwifjOTBaSp6ZwKdey5LanxulP0vk6US0qy0j0akeDe468g66Y/bWk6qgW44vpaqOSrNZlOo0Bc/oR1fWEzXxQB3QsKQ3lC13GbWDb0Vnn810PsvRyGH3BmjiTKJEGPeZTz6q6kB6AKIQqLpfHSy8LaJT4lFXWHLlT7y83", "has_jtag": true, "check_uboot": true, "boot_only": false, "path": "/dev/serial0", "reboot_after": true}
INFO:rooter:Waiting for Toon to restart
INFO:rooter:Toon has U-Boot version 2010.09-R8
INFO:rooter:Using password to log in
INFO:rooter:Logging in to U-Boot
DEBUG:rooter:
CPU:   Freescale i.MX27 at 400.168 MHz

Prodrive B.V. ED2.0
DRAM:  128 MiB
NAND:  128 MiB
LCD: Initializing LCD frambuffer at a1400000
LCD: 800x480, pbb 4
LCD: Drawing the logo...
In:    serial
Out:   serial
Err:   serial
Display-bmp: 800 x 480  with 16777216 colors
Net:   FEC
Warning: FEC MAC addresses don't match:
Address in SROM is         00:00:20:03:00:00
Address in environment is  00:0f:11:01:ea:b1


Enter password - autoboot in 2 sec...
U-Boot>
DEBUG:rooter:Logged in to U-Boot
INFO:rooter:Patching U-Boot
DEBUG:rooter:printenv
bootdelay=2
baudrate=115200
loadaddr=0xA1000000
bootdelay=2
mtdids=nand0=mxc_nand
mtdparts=mtdparts=mxc_nand:1M(u-boot)ro,512K(u-boot-env)ro,1536K(splash-image),3M(kernel),3M(kernel-backup),119M(rootfs)
mtdparts_kernel=mtdparts=mxc_nand:512K@0x00100000(u-boot-env)ro,1536K(splash-image),3M(kernel),3M(kernel-backup),119M(rootfs)
mem=128M
autoload=no
backlight_brightness=50
baudrate=115200
console=ttymxc0
addtty=setenv bootargs ${bootargs} console=${console},${baudrate}
addmtd=setenv bootargs ${bootargs} ${mtdparts_kernel}
addmisc=setenv bootargs ${bootargs} mem=${mem}
nandargs=setenv bootargs ubi.mtd=4 root=ubi0:rootfs rw rootfstype=ubifs
boot_nand=run nandargs addmtd addtty addmisc; nand read ${loadaddr} kernel; bootm ${loadaddr}
boot_nand_backup=run nandargs addmtd addtty addmisc; nand read ${loadaddr} kernel-backup; bootm ${loadaddr}
bootcmd=run boot_nand
splashimage=0x180000
ethact=FEC
sn=13-06-013-976
pn=6500-1200-3800
software_compatibility=0
manufacture_date=2013/02
ethaddr=00:0F:11:01:EA:B1

Environment size: 1012/131068 bytes
U-Boot>
DEBUG:rooter:printenv
DEBUG:rooter:bootdelay=2
DEBUG:rooter:baudrate=115200
DEBUG:rooter:loadaddr=0xA1000000
DEBUG:rooter:bootdelay=2
DEBUG:rooter:mtdids=nand0=mxc_nand
DEBUG:rooter:mtdparts=mtdparts=mxc_nand:1M(u-boot)ro,512K(u-boot-env)ro,1536K(splash-image),3M(kernel),3M(kernel-backup),119M(rootfs)
DEBUG:rooter:mtdparts_kernel=mtdparts=mxc_nand:512K@0x00100000(u-boot-env)ro,1536K(splash-image),3M(kernel),3M(kernel-backup),119M(rootfs)
DEBUG:rooter:mem=128M
DEBUG:rooter:autoload=no
DEBUG:rooter:backlight_brightness=50
DEBUG:rooter:baudrate=115200
DEBUG:rooter:console=ttymxc0
DEBUG:rooter:addtty=setenv bootargs ${bootargs} console=${console},${baudrate}
DEBUG:rooter:addmtd=setenv bootargs ${bootargs} ${mtdparts_kernel}
DEBUG:rooter:addmisc=setenv bootargs ${bootargs} mem=${mem}
DEBUG:rooter:nandargs=setenv bootargs ubi.mtd=4 root=ubi0:rootfs rw rootfstype=ubifs
DEBUG:rooter:boot_nand=run nandargs addmtd addtty addmisc; nand read ${loadaddr} kernel; bootm ${loadaddr}
DEBUG:rooter:boot_nand_backup=run nandargs addmtd addtty addmisc; nand read ${loadaddr} kernel-backup; bootm ${loadaddr}
DEBUG:rooter:bootcmd=run boot_nand
DEBUG:rooter:splashimage=0x180000
DEBUG:rooter:ethact=FEC
DEBUG:rooter:sn=13-06-013-976
DEBUG:rooter:pn=6500-1200-3800
DEBUG:rooter:software_compatibility=0
DEBUG:rooter:manufacture_date=2013/02
DEBUG:rooter:ethaddr=00:0F:11:01:EA:B1
DEBUG:rooter:
DEBUG:rooter:Environment size: 1012/131068 bytes
DEBUG:rooter:U-Boot>
DEBUG:rooter: setenv addmisc setenv bootargs \${bootargs} mem=\${mem} init=/bin/sh
U-Boot>
INFO:rooter:Waiting for boot up
DEBUG:rooter: run boot_nand

NAND read: device 0 offset 0x300000, size 0x300000
 3145728 bytes read: OK
## Booting kernel from Legacy Image at a1000000 ...
   Image Name:   Linux-2.6.36-R10-h27
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1944336 Bytes = 1.9 MiB
   Load Address: a0008000
   Entry Point:  a0008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.36-R10-h27 (jbraam@dvl) (gcc version 4.5.3 20110223 (prerelease) (GCC) ) #1 PREEMPT Tue Oct 25 20:03:05 CEST 2016
CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Prodrive B.V ED2.0
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: ubi.mtd=4 root=ubi0:rootfs rw rootfstype=ubifs mtdparts=mxc_nand:512K@0x00100000(u-boot-env)ro,1536K(splash-image),3M(kernel),3M(kernel-backup),119M(rootfs) console=ttymxc0,115200 mem=128M init=/bin/sh
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 126092k/126092k available, 4980k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffa00000 - 0xffe00000   (   4 MB)
    vmalloc : 0xc8800000 - 0xf4000000   ( 696 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0022000   ( 104 kB)
      .text : 0xc0022000 - 0xc0367000   (3348 kB)
      .data : 0xc037e000 - 0xc03a17a0   ( 142 kB)
Hierarchical RCU implementation.
        RCU-based detection of stalled CPUs is disabled.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:272
MXC IRQ initialized
MXC GPIO hardware
Console: colour dummy device 80x30
Calibrating delay loop (skipped) preset value.. 199.88 BogoMIPS (lpj=999424)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Configured for LCD: TM070RDH11
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource mxc_timer1
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
msgmni has been set to 246
io scheduler noop registered (default)
imx-fb imx-fb.0: PreserveUBootFramebuffer(1): xres=800, yres=480 [skip _update_lcdc]
imx-fb imx-fb.0: PreserveUBootFramebuffer(2): xres=800, yres=480 [skip _update_lcdc]
Console: switching to colour frame buffer device 100x30
imx-fb imx-fb.0: fb0: DISP0 BG fb device registered successfully.
imx-fb imx-fb.0: PreserveUBootFramebuffer(3): xres=800, yres=480 [skip _update_lcdc]
imx-fb imx-fb.0: fb1: DISP0 FG fb device registered successfully.
Serial: IMX driver
imx-uart.0: ttymxc0 at MMIO 0x1000a000 (irq = 20) is a IMX
console [ttymxc0] enabled
imx-uart.1: ttymxc1 at MMIO 0x1000b000 (irq = 19) is a IMX
imx-uart.2: ttymxc2 at MMIO 0x1000c000 (irq = 18) is a IMX
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 101 at 0x000000ca0000
Bad eraseblock 256 at 0x000002000000
Bad eraseblock 456 at 0x000003900000
Bad eraseblock 714 at 0x000005940000
RedBoot partition parsing not available
5 cmdlinepart partitions found on MTD device mxc_nand
Creating 5 MTD partitions on "mxc_nand":
0x000000100000-0x000000180000 : "u-boot-env"
0x000000180000-0x000000300000 : "splash-image"
0x000000300000-0x000000600000 : "kernel"
0x000000600000-0x000000900000 : "kernel-backup"
0x000000900000-0x000008000000 : "rootfs"
UBI: attaching mtd4 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: max. sequence number:       477172
UBI: attached mtd4 to ubi0
UBI: MTD device name:            "rootfs"
UBI: MTD device size:            119 MiB
UBI: number of good PEBs:        948
UBI: number of bad PEBs:         4
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 948
UBI: number of PEBs reserved for bad PEB handling: 9
UBI: max/mean erase counter: 1190/502
UBI: image sequence number:  979943203
UBI: background thread "ubi_bgt0d" started, PID 309
at25 spi0.0: 32 KByte at25640B eeprom, pagesize 64
spi_imx spi_imx.0: probed
FEC Ethernet Driver
fec_enet_mii_bus: probed
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
mxc-ehci mxc-ehci.0: initializing i.MX USB Controller
mxc-ehci mxc-ehci.0: portsc setup 1: 0x80000000
mxc-ehci mxc-ehci.0: Work around for USB enabled
ULPI transceiver vendor/product ID 0x04cc/0x1505
mxc-ehci mxc-ehci.0: Freescale On-Chip EHCI Host Controller
mxc-ehci mxc-ehci.0: new USB bus registered, assigned bus number 1
mxc-ehci mxc-ehci.0: irq 56, io mem 0x10024000
mxc-ehci mxc-ehci.0: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: Freescale On-Chip EHCI Host Controller
usb usb1: Manufacturer: Linux 2.6.36-R10-h27 ehci_hcd
usb usb1: SerialNumber: mxc-ehci.0
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
mxc-ehci mxc-ehci.2: initializing i.MX USB Controller
mxc-ehci mxc-ehci.2: portsc setup 1: 0x80000000
mxc-ehci mxc-ehci.2: Work around for USB enabled
mxc-ehci mxc-ehci.2: Freescale On-Chip EHCI Host Controller
mxc-ehci mxc-ehci.2: new USB bus registered, assigned bus number 2
mxc-ehci mxc-ehci.2: irq 55, io mem 0x10024400
mxc-ehci mxc-ehci.2: USB 2.0 started, EHCI 1.00
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: Freescale On-Chip EHCI Host Controller
usb usb2: Manufacturer: Linux 2.6.36-R10-h27 ehci_hcd
usb usb2: SerialNumber: mxc-ehci.2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
usbserial: USB Serial Driver core
input: TSC2007 Touchscreen as /devices/virtual/input/input0
rtc-isl1208 1-006f: chip found, driver version 0.3
rtc-isl1208 1-006f: rtc core: registered rtc-isl1208 as rtc0
i2c /dev entries driver
tmp431 0-004c: Could not read configuration register (-5)
imx2-wdt imx2-wdt.0: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=0)
adt7410 0-0048: adt7410 temperature sensor registered.
adt7410 0-0049: adt7410 temperature sensor registered.
nf_conntrack version 0.5.0 (1970 buckets, 7880 max)
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP cubic registered
NET: Registered protocol family 17
Bridge firewalling registered
rtc-isl1208 1-006f: setting system clock to 2018-05-26 06:07:42 UTC (1527314862)
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   119218176 bytes (116424 KiB, 113 MiB, 924 LEBs)
UBIFS: journal size:       9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:13.
Freeing init memory: 104K
usb 2-1: new high speed USB device using mxc-ehci and address 2
usb 2-1: New USB device found, idVendor=13d3, idProduct=3309
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1: Product: RTL8191S WLAN Adapter
usb 2-1: Manufacturer: Manufacturer Realtek
usb 2-1: SerialNumber: 00e04c000001
/bin/sh: can't access tty; job control turned off
/ #
INFO:rooter:Transferring payload
INFO:rooter:Patching Toon
DEBUG:rooter:/ #
DEBUG:rooter:sh payload/patch_toon.sh
DEBUG:rooter:cat: can't open '/dev/urandom': No such file or directory
INFO:rooter:Cleaning up
DEBUG:rooter:rm -r payload
/ #
INFO:rooter:Rebooting
INFO:rooter:Your Toon is now rooted. Please wait for it to boot up and try to log in using SSH

I try to SSH using this command:

ssh [email protected]
ssh: connect to host 192.168.1.130 port 22: Connection timed out

I'm 100% sure the IP is correct. Should I use the id_rsa file in any way?

No bootloader change and no SSH access after run

Hey Marten,

First of all, great and fun piece of work!
Thanks for this!

I wanted to let you know, it didn't work for me.
The instructions are clear and very useful.

Everything seems to run ok, but I see no changes after the script ran.
To me it seems that the OCD part didn't work, as the bootloader remains the same, to be exact: U-Boot 2010.09-R10 (Dec 14 2015 - 19:28:18)

How can I gather logging to find out what is going wrong?

*Setup: *

  • RPI3, cabling double checked.
  • Toon 1,
    • firmware 5.0.4,
    • bootloader 2010.09-R10

The script output:

pi@PI3_kamer:~/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
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
INFO:rooter:Using password to log in
INFO:rooter:Logging in to U-Boot
INFO:rooter:Patching U-Boot
INFO:rooter:Waiting for boot up
INFO:rooter:Transferring payload
INFO:rooter:Patching Toon
INFO:rooter:Cleaning up
INFO:rooter:Rebooting
INFO:rooter:Your Toon is now rooted. Please wait for it to boot up and try to log in using SSH
pi@PI3_kamer:~/ToonRooter $ 

Small issue with the Readme regarding raspi_confif

Hi,

Just trying to get my Toon to root and I think this script will be a good idea.

Though it's been a while since I have been playing with raspberry pi.

I kept trying to type in "raspi_config" without the quotes of course and then tried to use sudo as well because it was not working.

Then Google told me to use "sudo raspi-config" your Readme says a underscore "_" though it should be a "-" in between.

Now I'm at the pinout and you might want to add some more information about this too.

I wasn't sure if it's

1 2
3 4
..
Or

1 8
2 9

Google once helped me out

1 2
3 4

Now all I have left is getting a power supply and giving it a shot.

Thank you,

Request to log generated password

Would it be possible to save the generated root password to a file? I was stupid enough to not write it down (root access only achieved after midnight and after several hours of tinkering) so I basically have to do it all again for my R10 Toon model...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.