Toon firmware - update script

Forum about the Toon firmware, and its extensions

Moderators: marcelr, TheHogNL, Toonz

RomMon
Starting Member
Starting Member
Posts: 44
Joined: Mon Aug 29, 2016 9:05 pm

Re: Toon firmware - update script

Post by RomMon »

@TheHogNL

Maybe not an enforcing check but e.g.
if [ "$lastKnownHash" -eq "$dlScripHash" ]; then
continue upgrade without warning
else
echo "Warning: The script you downloaded has changed from the verified script. Please only continue after confirming the changes are ok."
only continue if user gives ok
fi
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon firmware - update script

Post by TheHogNL »

Good idea. I'll do that in the next update.
Member of the Toon Software Collective
jnieuw
Starting Member
Starting Member
Posts: 43
Joined: Fri Oct 13, 2017 2:41 pm

Re: Toon firmware - update script

Post by jnieuw »

Just wanted to thank you for the script.
Upgraded from 4.8.25 to 4.10.6 and then to 4.13.7! :D
hansgrave
Starting Member
Starting Member
Posts: 49
Joined: Sat Dec 23, 2017 12:42 pm

Re: Toon firmware - update script

Post by hansgrave »

After a succesfull update to 4.10.6 now my Toon hangs after a reboot to update to 4.13.7 .... I can acces the Toon with ssh, how can i solve this problem?
Homey, rooted Toon 1 and HomeAssistent.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon firmware - update script

Post by TheHogNL »

By hangs you mean the screen keeps on his orange 'TOON' display?

If yes, it's the QT-GUI that is not starting due to an error.
Try starting the GT-GUI with logging enabled. Change this in /etc/inittab and reboot.
normal:
qtqt:245:respawn:/usr/bin/startqt >/dev/null 2>&1
change to:
qtqt:245:respawn:/usr/bin/startqt >/var/log/qt 2>&1

You could read the /var/log/qt then after rebooting (for example "tail -f /var/log/qt") and hopefully find the error why qt-gui isn't starting
Member of the Toon Software Collective
hansgrave
Starting Member
Starting Member
Posts: 49
Joined: Sat Dec 23, 2017 12:42 pm

Re: Toon firmware - update script

Post by hansgrave »

TheHogNL wrote:By hangs you mean the screen keeps on his orange 'TOON' display?

If yes, it's the QT-GUI that is not starting due to an error.
Try starting the GT-GUI with logging enabled. Change this in /etc/inittab and reboot.
normal:
qtqt:245:respawn:/usr/bin/startqt >/dev/null 2>&1
change to:
qtqt:245:respawn:/usr/bin/startqt >/var/log/qt 2>&1

You could read the /var/log/qt then after rebooting (for example "tail -f /var/log/qt") and hopefully find the error why qt-gui isn't starting
I changed the the file and reboot several times, at this time i have no longer have acces by ssh...
Homey, rooted Toon 1 and HomeAssistent.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon firmware - update script

Post by TheHogNL »

hansgrave wrote:I changed the the file and reboot several times, at this time i have no longer have acces by ssh...
Weird. Just rebooting should not break your ssh access. Did the Toon change IP? Try to follow the 'how to root' manual again to gain console access and check what is going on.
Member of the Toon Software Collective
FunFair
Starting Member
Starting Member
Posts: 42
Joined: Sun Oct 01, 2017 11:40 am

Re: Toon firmware - update script

Post by FunFair »

Used the script to go from 4.9 to 4.13.
I thought it would make the upgrade in 1 time, but it seemed the script installed 4.10 first.

Had to open the openvpn connection to eneco servers first. But didn't have to uninstall Toonstore. That's great.
Afterwards I had to disable the vpn connection again, cause it kept resetting the 'enddate' from -1 to something else.

Thanks for the work on this script! And opening another session with the logging file helped alot to see what was happening!
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon firmware - update script

Post by TheHogNL »

"had to open the vpn first" ? The script does this for you and will also protect your Toon so your enddate will not be overwritten.
I think you used the Eneco upgrade-qb2.sh script manually and not thise update-rooted.sh script?
Member of the Toon Software Collective
FunFair
Starting Member
Starting Member
Posts: 42
Joined: Sun Oct 01, 2017 11:40 am

Re: Toon firmware - update script

Post by FunFair »

TheHogNL wrote:"had to open the vpn first" ? The script does this for you and will also protect your Toon so your enddate will not be overwritten.
I think you used the Eneco upgrade-qb2.sh script manually and not thise update-rooted.sh script?
I used v1.8 and it paused (I think) because it was waiting for the VPN to connect. Maybe I was just impatient.. I went in the inittab file and uncommented the VPN part.
I think the script continued on its own while I was doing this oops. I'll remember that for next time :)

BTW is it possible to update without the VPN connection? Someone in the domoticz forum asked me if that was possible. He has a rooted toon done by quby, but has no VPN data anymore. So he can't seem to update his toon with this script.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon firmware - update script

Post by TheHogNL »

The 'wait' moment was opening the vpn for you indeed. Just uncommenting the inittab does nothing without a reboot. But now I understand why your enddate changed because after the reboot you still had the openvpn uncommented resulting in the servicecenter from eneco to connect again and change the value.

Next time be more patient indeed. Maybe I need to change the text to be even more stupid proof :lol:

Updating the Toon from another source could be possible as it is just a bunch of files which are downloaded and then installed. However I am not planning to build that into the script as that might open the route to unsollicated software/mallware and I'm not sure copying the files to another server is legally allowed.
Member of the Toon Software Collective
Fietspomp
Starting Member
Starting Member
Posts: 27
Joined: Tue Jan 30, 2018 12:09 pm

Re: Toon firmware - update script

Post by Fietspomp »

Tried your script today, but it can't download the update script, this is the outcome of the log:

Code: Select all

=================================================================================================================================-=================================
Welcome to the rooted Toon upgrade script. This script will try to upgrade your Toon using your original connection with Eneco. It will start the VPN if necessary.
Please be advised that running this script is to your own risk!

Version: 1.8 - ThehogNL - 8-3-2018

===================================================================================================================================================================

You are currently running version 3.2.18

Which version do you want to upgrade to? You can look at the list of currently known Toon versions at https://notepad.pw/raw/6fmm2o8ev
4.10.6
Alright, I will try to upgrade to 4.10.6
Waiting for tunnel to be alive and configured...
Waiting for tunnel to be alive and configured...
Tunnel is alive and configured. Now trying to download upgrade script...
/mnt/data/update/upgrade-qb2.sh: No such file or directory
Could not download the upgrade script from the source. Exiting...
Root is working properly, tried it several times also after a reboot.
Any suggestions howto debug this?

EDIT: Fixed it, found that my mnt dir was empty.
So I changed location in your script

Code: Select all

PKGCACHE='/HCBv2/tmp/opkg-cache'
if [ ! -d "$PKGCACHE" ] 
then
  PKGCACHE='/HCBv2/tmp/opkg-cache'
fi
Probably a dirty change but it works :-)
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon firmware - update script

Post by TheHogNL »

Yes I already changed that in another release which I'm building. Your Toon was already supporting the new directory /mnt/data/update but the old dir was still there. Causing the Eneco Upgrade to fail because it expects in in the new dir.
So the script uses the old dir. The new logic is that it uses the new dir if that dir is supported by the toon.

So the proper fix is:

Code: Select all

PKGCACHE='/mnt/data/update'
if ! strings /HCBv2/sbin/hcb_config | grep -q -e "^${PKGCACHE}\$"
then
        #this toon still uses the old PKGCACHE
        PKGCACHE='/HCBv2/tmp/opkg-cache'
fi
Member of the Toon Software Collective
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon firmware - update script

Post by TheHogNL »

Thinking about this makes me me wonder if I need to create the directory if it doesn't exists. However, according to the upgrade script the /mnt/data/update dir should be automatically created upon booting of the toon
Member of the Toon Software Collective
Fietspomp
Starting Member
Starting Member
Posts: 27
Joined: Tue Jan 30, 2018 12:09 pm

Re: Toon firmware - update script

Post by Fietspomp »

Just used your script for my own Toon (2nd hand now hanging on the wall :D ).
This has the latest firmware and old u-boot, works perfect as well!
Only manually installed latest busybox, using your payload files to transfer them.

So your script works fine for me!
Post Reply

Return to “Toon Firmware”