Page 1 of 1

Toon Recovery

PostPosted: Mon Jun 17, 2019 5:41 pm
by TheHogNL
Hi all,

I am proud to announce a new TSC tool, called Toon Recovery. https://github.com/ToonSoftwareCollective/ToonRecovery

This is posted in the Toon Hardware section as this tool allows you to recover your Toon if it is not booting anymore. Only a working uboot is necessary to recover your Toon.
It will load a default factory image to your Toon as if it was fresh from the box. With all those broken Toon due to faulty firmware updates from Eneco I decided it was time to release this wonderful piece of engineering.

It has not been tested a lot. But then again, if your Toon gets broken you can always recover it with a newer version of this software if you provide me with the details why your Toon got bricked using this software :lol:

And as with the update script, if you like my software and want to support me to allow me to develop more you can always donate on https://paypal.me/pools/c/8bU3eQp1Jt

Re: Toon Recovery

PostPosted: Mon Jul 08, 2019 4:06 pm
by jozg
Hello TheHog,

I'll try tomorrow, for now i prepared some things:

I just installed a rpi, and made the same rpi an nfs server.
So now i need to connect the serial wires 3st, and i don't need the jtag, because i have an old loader.
Both the rpi and the toon needs to be connected to the wired ethernet switch.

Give it a try tomorrow.

Thanks for helping me out!.

Regards,

Re: Toon Recovery

PostPosted: Mon Jul 08, 2019 4:19 pm
by TheHogNL
Yes and make sure you have enabled NFSv2 (btw: I moved your message to the topic for recovery)

Re: Toon Recovery

PostPosted: Tue Jul 09, 2019 12:35 pm
by jozg
Hello theHog,

You saved my Toon and my life ;-)
I use one single raspberry.
After the reset, i connected my usb uart connection, but i wan't to use minicom on the same raspberry pi, but i seemed not to find the correct port to connect to.
If that worked, i should be able to recover with a single pi, instead of using my windows pc with putty and the uart. But it worked ;-)

Then i backupped the VPN config, and then format and recover to 4.20.7, and after that i recover the VPN config again.
Everything went fine!, thanks. Maybe nice to notice, the root password has changed to 'toon' in stead of my own.

Thanks for the good work!.

I used these steps (on my pi3):

sudo apt-get install nfs-kernel-server portmap nfs-common
sudo nano /etc/exports

add this:
/srv/nfs *(rw,no_subtree_check,async,no_root_squash)

sudo /etc/init.d/nfs-kernel-server restart
mkdir -p /srv/nfs
cd /srv/nfs
curl -Nks "http://qutility.nl/toon-recovery-nfs-server-image.tar.gz" | tar zxvf -

To enable NFS v2 i hinted from: https://ubuntuforums.org/showthread.php?t=2381512

edit /etc/default/nfs-kernel-server

Change:

RPCNFSDCOUNT=8

to:

RPCNFSDCOUNT="-V 2 8"

And change:

RPCMOUNTDOPTS="--manage-gids"

to:

RPCMOUNTDOPTS="-V 2 --manage-gids"

then issue:

sudo service nfs-kernel-server restart

Re: Toon Recovery

PostPosted: Tue Jul 09, 2019 1:03 pm
by TheHogNL
Minicom should be able to use /dev/serial (the one which the toon recovery uses also, per default).
I'm using a usb uart myself on the Pi and not using the Pi's serial port itself. But again, it should work. Unknown why it didn't work for you.

But great to hear that you managed to repair your toon using the tool and providing some steps also! And yes, 'toon' is the root password after recovery. I will put that in the README

Re: Toon Recovery

PostPosted: Tue Jul 16, 2019 6:22 pm
by CrumNL
The script looks good and very useful for sure.
I'm just not getting it any further to boot from nfs for some reason.
I'm using a rpi3, tried nfs with only v2, v2&v3, all versions, but the script won't bite despite me being able to mount the same path manually.
After "Loading kernel into memory from server. Should not take more than 60 seconds ..."
It stops with Error loading from NFS server. I tried with nfs on the rpi and with a NAS but that gives the same result.
I'm uncertain if it is something in the script or something I'm messing up, any suggestions are welcome :)

Re: Toon Recovery

PostPosted: Tue Jul 16, 2019 7:08 pm
by TheHogNL
This is most certain because the NFS isn't providing NFS versions 2. The uboot kernel loading over NFS works only over NFS.

So check with "cat /proc/fs/nfsd/versions" and follow the README

And also check the server log files to see if your Toon tries to connect.

Re: Toon Recovery

PostPosted: Tue Jul 16, 2019 11:03 pm
by CrumNL
I did a reinstall of raspbian stretch and followed the rpi3 instructions and readme but it doesn't seem to coorporate or I just don't get it.
When I look at the versions file, that doesn't seem to change no matter what I edit in nfs-kernel-server or the exports file.
In it, all versions are listed with +
Also when I juggle with the parameters I had it with only +2 and the rest -.
But, no connection.

Until suddenly I now get it at a timeout to quit. :
Code: Select all
pi@raspberrypi:~/ToonRecovery $ ls
assets   __main__.py  recovery.py   toon-recovery-nfs-server-image.tar.gz
LICENSE  README.md    recovery.pyc
pi@raspberrypi:~/ToonRecovery $ sudo python . --jtag-available --gatewayip 192.168.2.254
INFO:__main__:Starting up...
INFO:__main__:Detected JTAG hardware 'rpi3'
INFO:__main__:Setting server ip to 192.168.2.87
INFO:recovery:Waiting for Toon to restart
INFO:recovery:Toon has U-Boot version 2010.09-R8
INFO:recovery:Using password to log in
INFO:recovery:Logging in to U-Boot
INFO:recovery:Patching U-Boot
INFO:recovery:Requesting network details using DHCP...
INFO:recovery:Received valid IP address, netmask and gateway using DHCP.
INFO:recovery:Loading kernel into memory from server. Should not take more than 60 seconds ...
INFO:recovery:Timeout loading from NFS server
pi@raspberrypi:~/ToonRecovery $ ls /srv/nfs/
dumps/      toon/       uImage-nfs


I see an authenticated connection that gets logged every minute or so
Code: Select all
Jul 16 21:43:41 raspberrypi rpc.mountd[473]: authenticated mount request from 192.168.2.3:1000 for /srv/nfs/toon/boot (/srv/nfs)
Jul 16 21:44:54 raspberrypi rpc.mountd[473]: authenticated mount request from 192.168.2.3:1000 for /srv/nfs/toon/boot (/srv/nfs)
Jul 16 21:46:06 raspberrypi rpc.mountd[473]: authenticated mount request from 192.168.2.3:1000 for /srv/nfs/toon/boot (/srv/nfs)
Jul 16 21:47:19 raspberrypi rpc.mountd[473]: authenticated mount request from 192.168.2.3:1000 for /srv/nfs/toon/boot (/srv/nfs)
Jul 16 21:48:36 raspberrypi rpc.mountd[473]: authenticated mount request from 192.168.2.3:1000 for /srv/nfs/toon/boot (/srv/nfs)


And it looks to me like it does run v2 :
Code: Select all
Jul 16 22:58:14 raspberrypi systemd[1]: Reached target Host and Network Name Lookups.
Jul 16 22:58:14 raspberrypi systemd[1]: Starting Preprocess NFS configuration...
Jul 16 22:58:14 raspberrypi systemd[1]: Started Preprocess NFS configuration.
Jul 16 22:58:14 raspberrypi systemd[1]: Starting Notify NFS peers of a restart...
Jul 16 22:58:14 raspberrypi systemd[1]: Starting NFS status monitor for NFSv2/3 locking....
Jul 16 22:58:15 raspberrypi sm-notify[1470]: Version 1.3.3 starting
Jul 16 22:58:15 raspberrypi systemd[1]: Started Notify NFS peers of a restart.
Jul 16 22:58:15 raspberrypi rpc.statd[1473]: Version 1.3.3 starting
Jul 16 22:58:15 raspberrypi rpc.statd[1473]: Flags: TI-RPC
Jul 16 22:58:15 raspberrypi rpc.statd[1473]: Failed to read /var/lib/nfs/state: Success
Jul 16 22:58:15 raspberrypi rpc.statd[1473]: Initializing NSM state
Jul 16 22:58:15 raspberrypi systemd[1]: Started NFS status monitor for NFSv2/3 locking..

I guess I'll have to find out more about forcing only nfs v2.

Re: Toon Recovery

PostPosted: Wed Jul 17, 2019 11:06 am
by TheHogNL
It does not need to be only v2. Try the script with debug and send the log here.

Re: Toon Recovery

PostPosted: Fri Jul 19, 2019 7:53 pm
by TheHogNL
Just updated the recovery image because I had a bug in the menu script (which runs after the toon recovery has booted the toon). So download the image file again and unpack it. Only /menu.sh is updated so you can also only unpack that from the recovery image .tar.gz

Re: Toon Recovery

PostPosted: Sun Aug 04, 2019 10:55 am
by CrumNL
I've used the latest version from github, it looks like the nfs mount works but it keeps stopping with an error.
Error loading from NFS server

I'm not sure how to get any further debug output or log file besides daemon log or syslog output.

When I use an external nfs share :
Image

When I use the rpi3's nfs share :
syslog:
Image

daemon log :
Image

Manually from uboot gives some additional output :
Image

Re: Toon Recovery

PostPosted: Sun Aug 04, 2019 4:56 pm
by TheHogNL
Check with tcpdump on your server if the packets are correctly sent. Could be packet corruption or something like that.
And you are sure the uImage-nfs file is in that dir?