Fully automated rooting script

Everything about rooting Toons 1 and 2.

Moderators: marcelr, TheHogNL, Toonz

TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post by TheHogNL »

DEBUG:rooter:UBIFS error (pid 371): ubifs_read_node: bad node type (255 but expected 0)
DEBUG:rooter:UBIFS error (pid 371): ubifs_read_node: bad node at LEB 388:24000
DEBUG:rooter:UBIFS error (pid 371): ubifs_iget: failed to read inode 12188, error -22

So your Toon's internal flash is bad. Not sure if this is even fixable. Does the toon even boot without it being rooted?
Member of the Toon Software Collective
frank-pda
Starting Member
Starting Member
Posts: 8
Joined: Wed Jan 23, 2019 5:53 pm

Re: Fully automated rooting script

Post by frank-pda »

Yes the toon reboots and i also tried to do the install via Minicom log in as Root end do the

After starting the rooting script with --dont-cleanup-payload
i started minicom /dev/(serial0 ) en login to the Toon.

I mad the modification with:
setenv addmisc setenv bootargs \$\{bootargs\} mem=\$\{mem\} lpj=999424 init=/bin/sh
run boot nand

I do get the prompt but when i try to install it manualy
opkg install dropbear_2015.71-r0_qb2.ipk

also get an error about the package.IPK
It was ubale to unpack
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 package that is wrong. Once running opkg (the package manager) it will follow some directories, including /usr/lib/opkg/info and there is corrupted file in there. Resulting in the UBIFS error message and next the toon going into read-only mode due to that error.

Try to open that file before installing dropbear and you probably hit the same error also ("cat /usr/lib/opkg/info/jansson.list")
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 »

Also, post the result of "ubinfo -a"
Member of the Toon Software Collective
WilcoSnel
Starting Member
Starting Member
Posts: 11
Joined: Fri Jan 25, 2019 2:43 pm

Re: Fully automated rooting script

Post by WilcoSnel »

WilcoSnel wrote:After struggling with some wires I finally managed to root the Toon using this awesome script.
I re-assembled and booted the thing as it was getting quite chilly.
After booting and connecting to wifi it is now asking for the activation key, so I wanna run the update-rooted-toon script with -f parameter remotely so I don't have to take it apart again.

However I can't connect remotely to it.
My computer can ping the Toon, but when I try to connect with putty using the ip address, port 22 and SSH selected, it just times out.
I should be able to connect remotely after ToonRooter has completed right?
Or should I have done something else before re-assembling it?
I checked the ToonRooter folder on my Pi3B+ and it includes the id_rsa and id_rsa.pub files.
So I verified the IP of Toon again, made sure I was in the ToonRooter folder on my Pi and ran "ssh -i id_rsa root@192.168.178.128" from my Pi3B+, but still times out.
Tried "sudo ssh -i id_rsa root@192.168.178.128" as well, but same result.

Can anyone help out with this?
Kinda on a dead end here and not sure if I will be able to connect remotely or if I'll have to disassemble again and connect through serial to try and fix this.
Seeing as the readme states to "Install and set up dropbear and sftp-server to let root user log in using an ssh key" and this has finished, I should be able to right?
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post by TheHogNL »

WilcoSnel wrote:
WilcoSnel wrote:After struggling with some wires I finally managed to root the Toon using this awesome script.
I re-assembled and booted the thing as it was getting quite chilly.
After booting and connecting to wifi it is now asking for the activation key, so I wanna run the update-rooted-toon script with -f parameter remotely so I don't have to take it apart again.

However I can't connect remotely to it.
My computer can ping the Toon, but when I try to connect with putty using the ip address, port 22 and SSH selected, it just times out.
I should be able to connect remotely after ToonRooter has completed right?
Or should I have done something else before re-assembling it?
I checked the ToonRooter folder on my Pi3B+ and it includes the id_rsa and id_rsa.pub files.
So I verified the IP of Toon again, made sure I was in the ToonRooter folder on my Pi and ran "ssh -i id_rsa root@192.168.178.128" from my Pi3B+, but still times out.
Tried "sudo ssh -i id_rsa root@192.168.178.128" as well, but same result.

Can anyone help out with this?
Kinda on a dead end here and not sure if I will be able to connect remotely or if I'll have to disassemble again and connect through serial to try and fix this.
Seeing as the readme states to "Install and set up dropbear and sftp-server to let root user log in using an ssh key" and this has finished, I should be able to right?
First thing, yes disassemble it and connect the wires again. Or else you wont get in. Try the rooter again and, before assembling try to login to your toon.
If not, try to get into the toon using the serial method and the manual rooting guide. Probably dropbear didn't install properly or the iptables firewall wasn't modified. Try to pay attention at what the script is saying.
Member of the Toon Software Collective
frank-pda
Starting Member
Starting Member
Posts: 8
Joined: Wed Jan 23, 2019 5:53 pm

Re: Fully automated rooting script

Post by frank-pda »

Good afternoon TheHogNL.

I tried several cmd's but UBINFO is not present.
Here is what it wrote to my screen.

Still hope you can help.
===========================================

Welcome to minicom 2.7

OPTIONS: I18n
Compiled on Apr 22 2017, 09:14:19.
Port /dev/serial0, 11:17:02

Press CTRL-A Z for help on special keys

sh: bad number
stopped /usr/sbin/chronyd (pid 659)


U-Boot 2010.09-R8 (Dec 03 2012 - 12:50:30)

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:03:28:af


Enter password - autoboot in 2 sec...
U-Boot> ubinfo -a
Unknown command 'ubinfo' - try 'help'

U-Boot>
setenv addmisc setenv bootargs \$\{bootargs\} mem=\$\{mem\} lpj=999424 init=/bin/sh
U-Boot> 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 lpj=999424 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 0 at 0x000000000000
Bad eraseblock 463 at 0x0000039e0000
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: 543176
UBI: attached mtd4 to ubi0
UBI: MTD device name: "rootfs"
UBI: MTD device size: 119 MiB
UBI: number of good PEBs: 951
UBI: number of bad PEBs: 1
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: 951
UBI: number of PEBs reserved for bad PEB handling: 9
UBI: max/mean erase counter: 1387/570
UBI: image sequence number: 1384663319
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 <maxk@qualcomm.com>
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 2019-01-27 13:18:41 UTC (1548595121)
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size: 119605248 bytes (116802 KiB, 114 MiB, 927 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=148f, idProduct=5370
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1: Product: 802.11 n WLAN
usb 2-1: Manufacturer: Ralink
usb 2-1: SerialNumber: 1.0
/bin/sh: can't access tty; job control turned off
/ # ubinfo -a
ubinfo: error!: UBI is not present in the system
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post by TheHogNL »

frank-pda wrote:Good afternoon TheHogNL.

I tried several cmd's but UBINFO is not present.
Here is what it wrote to my screen.

Still hope you can help.
Have send you a PM to see I if can help over teamviewer.
Member of the Toon Software Collective
WilcoSnel
Starting Member
Starting Member
Posts: 11
Joined: Fri Jan 25, 2019 2:43 pm

Re: Fully automated rooting script

Post by WilcoSnel »

TheHogNL wrote:First thing, yes disassemble it and connect the wires again. Or else you wont get in. Try the rooter again and, before assembling try to login to your toon.
If not, try to get into the toon using the serial method and the manual rooting guide. Probably dropbear didn't install properly or the iptables firewall wasn't modified. Try to pay attention at what the script is saying.
You were right. Dropbear and did not install properly according to a debug log of the ToonRooter. So will have to try that manually.
However now I can't even get into U-Boot.

I've reset it about 100 times and right clicked to paste or right click in combination with enter, but it just does not interrupt start-up of the toon.
At first it did not even show my pastes untill it had completed the start-up.
So checked baud settings in minicom on my Pi3B+, enabled local echo and disabled hardware flow control.
This allowed me to paste as soon as serial data started to come in.
But it's just not interrupting the boot (see below), as if it's not recognizing it. Tried to switch the TxD and RxD as well, but this resulted in no output at all.
Had a proper google on being able to read, but not write with minicom, but only the fixes that popped up were the ones I already tried.

Do you have any ideas on how to fix this?
Tnx for helping this far, hopefully we can crack this.

Code: Select all

U-Boot 2010.09-R10 (Dec 14 2015 - 19:28:18)

CPU:   Freescale i.MX27 at 400.168 MHz

Prodrive B.V. ED2.0
DRAM:  128 MiB
NAND:  128 MiB
toon
toonLCD: Initializing LCD frambuffer at a1400000
LCD: 800x480, pbb 4
LCD: Drawing the logo...
In:
serial
Out:   serial
Err:   serial
Configure for LCD: TDA-WVGA0700F00048
LCD: Initializing LCD frambuffer at a1400000
LCD: 800x480, pbb 4
LCD: Drawing the logo...
toon
toon
Display-bmp: 800 x 480  with 16777216 colors
toon
toon
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:08:9b:9a


Enter password - autoboot in 2 sec...
toon

NAND read:
toontoon
device 0 offset 0x300000, size 0x300000

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

Re: Fully automated rooting script

Post by TheHogNL »

WilcoSnel wrote:
Do you have any ideas on how to fix this?
Tnx for helping this far, hopefully we can crack this.

Code: Select all

U-Boot 2010.09-R10 (Dec 14 2015 - 19:28:18)
Your U-boot isn't patched yet. R10 is the one which requires patching by openocd or using the toon rooter python script. After being patched the boot version would be 2010.09 (without R10) and then the password is toon.

So rerun the python rooter again.
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 »

TheHogNL wrote:
frank-pda wrote:Good afternoon TheHogNL.

I tried several cmd's but UBINFO is not present.
Here is what it wrote to my screen.

Still hope you can help.
Have send you a PM to see I if can help over teamviewer.
Frank was lucky that he lives on the route from my work to home. I picked up his flash corrupted toon today. After plugin it into my test environment it was clear that this toon has died. Corrupted filesystem, bad flash blocks etc. But I was able to reformat the flash (loosing some kilobytes due to the bad blocks) and restore his toon using another toon as donor. This required the toon to be TFTP/NFS booted (see the recovery manual from marcel) and me to do some ubifs magic.
Member of the Toon Software Collective
aabre
Starting Member
Starting Member
Posts: 42
Joined: Sun Nov 05, 2017 1:26 pm
Location: Schiedam

Re: Fully automated rooting script

Post by aabre »

Hi guy's.
I started again on my died Toon from last season. R.I.P.

this is what left from the boot process:
…………
UBIFS: recovery needed
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
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size: 119476224 bytes (116676 KiB, 113 MiB, 926 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
Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
[<c00273d0>] (unwind_backtrace+0x0/0xf0) from [<c029e720>] (panic+0x60/0x190)
[<c029e720>] (panic+0x60/0x190) from [<c00223dc>] (init_post+0x78/0xc4)
[<c00223dc>] (init_post+0x78/0xc4) from [<c0008b54>] (kernel_init+0x110/0x14c)
[<c0008b54>] (kernel_init+0x110/0x14c) from [<c00238ec>] (kernel_thread_exit+0x0/0x8)

So I try hard to understand de manual from Marcel about the bricked Toon
First started with the tftpboot TFTP server on my Rpi3 and downloaded the binair file uImage-nfs from this form.
After some days it started to work and I can boot the Toon from this image like this:

Code: Select all

U-Boot> dhcp
BOOTP broadcast 1
*** Unhandled DHCP Option in OFFER/ACK: 28
*** Unhandled DHCP Option in OFFER/ACK: 28
DHCP client bound to address 192.168.23.215

U-Boot> setenv serverip 192.168.23.3
U-Boot> tftpboot 0xA1000000 uImage-nfs
Using FEC device
TFTP from server 192.168.23.3; our IP address is 192.168.23.215
Filename 'uImage-nfs'.
Load address: 0xa1000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##################################
done
Bytes transferred = 2503412 (2632f4 hex)


U-Boot> bootm
## Booting kernel from Legacy Image at a1000000 ...
   Image Name:   Linux-2.6.36-R07-h21
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2503348 Bytes = 2.4 MiB
   Load Address: a0008000
   Entry Point:  a0008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

But it stops at the line "booting the kernel" and nothings happening.
so I started to follow the manual and installed a NFS server on my Pi and untarred the image image-base-qb2.tar.gz from the site.
And it looks like the Toon boot uittil a ~# prompt where I can see that it's connected to the rootfs directory from my Pi

But now I'm lose controle and see that there are no devices on that rootfs image, /proc /sys etc. are empty and I understand that there must be done something at this point, but I need a push in the right direction.
Questions:
Do I have the correct images ?
what is my next step to do ?

allready very proud that I came so far :roll:
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post by TheHogNL »

Yes the device nodes are not created automatically. I noticed that also. I solved it with making some important device nodes myself.

First mount /proc and /sys:

Code: Select all

mount /proc
mount -t sysfs none /sys
then create the /dev nodes:

Code: Select all

mknod /dev/mtd1 c  90 2 
mknod /dev/mtd2 c 90 4 
mknod /dev/mtd4 c 90 8 
mknod /dev/ubi0 c 252 0 
mknod /dev/ubi0_0 c 252  1
mknod /dev/ubi_ctrl c 10 63
You would now able to mount the broken rootfs:

Code: Select all

mkdir /mnt/rootfs
mount -t ubifs ubi0:rootfs /mnt/rootfs
Member of the Toon Software Collective
aabre
Starting Member
Starting Member
Posts: 42
Joined: Sun Nov 05, 2017 1:26 pm
Location: Schiedam

Re: Fully automated rooting script

Post by aabre »

Ik kom aardig ver maar hij heeft een Ubi probleem ben ik bang

/ # mount -t ubifs ubi0:rootfs /mnt/rootfs
UBIFS error (pid 412): ubifs_get_sb: cannot open "ubi0:rootfs", error -19
mount: mounting ubi0:rootfs on /mnt/rootfs failed: No such device


/ # ubinfo -a
UBI version: 1
Count of UBI devices: 0
UBI control device major/minor: 10:63

Maar !!! ik heb wel m'n proc en sys weer terug, geweldig !!


/ # df -a
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 29794332 5030192 23488224 18% /
proc 0 0 0 0% /proc
none 0 0 0 0% /sys


/ # cat /proc/mtd
dev: size erasesize name
mtd0: 00080000 00020000 "u-boot-env"
mtd1: 00180000 00020000 "splash-image"
mtd2: 00300000 00020000 "kernel"
mtd3: 00300000 00020000 "kernel-backup"
mtd4: 07700000 00020000 "rootfs"

Zou ik nu met dd een binaire backup terug kunnen zetten voor bv mtd2 (kernel)?
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Fully automated rooting script

Post by TheHogNL »

Je moet nog "ubiattach -p /dev/mtd4" voordat je mount
Als dat niet werkt "ubiattach -O 2048 -p /dev/mtd4" (voor sommige toon's is dat nodig)
Member of the Toon Software Collective
Post Reply

Return to “Toon Rooting”