Page 1 of 2

Updating toon without losing ssh access

Posted: Sun Jul 23, 2017 1:42 am
by martjah
Hi,

I've been doing a lot of reading about Toon in combination with Domoticz. So i bought a Toon on Marktplaats and followed multiple manuals installing appliactions etc. I also unlocked the gas/power history.
But it has been nagging me that i did not run the latest version. I was running 3.6.3 but i wanted the latest version (currently: 4.4.21). But the Toon was hanging on the wall and i did not want te remove it and connect the cables to get access again. So i started thinking about using Cron te replace the crucial files after every reboot. So i did some testing and is succesfully updated my toon without losing SSH access. But i did lose the extra programs, unlocked features (but thats alright, thats not to much work).

Code: Select all

1. Install Cron (see the post about installing the wasteapp)
2. Copy /etc/default/iptables.conf  to /root/iptables.conf
3. Copy /etc/passwd to /root/passwd
4. open Crontab (Crontab -e) and enter the following
[i]@reboot cp /root/iptables.conf /etc/default/iptables.conf
@reboot cp /root/passwd /etc/passwd[/i]
5. Open up the VPN connection to Eneco  (remove the # bevore OPENVPN in the /etc/inittab  file)
6. reboot Toon
7. update Toon (mine had to update twice)
At this point you will lose SSH access after the first reboot.
8. Reboot Toon again
SSH access will be restored after this reboot.
9. Close the OpenVPN connection again  (add the # bevore OPENVPN in the /etc/inittab  file)
But remember, if you update the IPtables or passwd file in the future, it will be replaced after every reboot (unless you change something). Also version 4 feels faster.

Re: Updating toon without losing ssh access

Posted: Mon Jul 24, 2017 7:37 pm
by martjah
Update: All your custom apps are still on your Toon, you just have to add them again to your globals file.
Also i got the 403 forbidden message back. The projects file is now in "HCBv2\etc\qmf_project.xml".
I changed:

Code: Select all

<hcb_web>
		
	<!-- Release uses lighttpd; put hcb_web somewhere where its harmless -->

	<port>7080</port>
		
	<defaultEntry>/hdrv_zwave/</defaultEntry>
		
	<enforceWhitelist>1</enforceWhitelist>
		
	<whitelist>
			
		<item>hdrv_zwave</item>
			
		<item>hdrv_hue</item>
		
	</whitelist>
	
	</hcb_web>
to:

	<hcb_web>
		<!-- Release uses lighttpd; put hcb_web somewhere where its harmless -->
		<port>10080</port>
		<defaultEntry>/HCBv2/www/</defaultEntry>
		<enforceWhitelist>0</enforceWhitelist>
		<whitelist>
			<item>hdrv_zwave</item>
			<item>hdrv_hue</item>
		</whitelist>
	</hcb_web>
And i had x11VNC installed but that stopped working also. There seems to be a newer version installed out of the box. Due to my lack of linux/vnc knowledge i just removed the package and installed the one from the download section.
1. opkg remove x11vnc
2. install x11vnc package from the downloads section

Re: Updating toon without losing ssh access

Posted: Mon Jul 24, 2017 7:56 pm
by Toonz
Nice ;-)

Re: Updating toon without losing ssh access

Posted: Sun Jan 14, 2018 9:26 pm
by FunFair
Works as a charm! Thanks for this guide. :)

Re: Updating toon without losing ssh access

Posted: Wed Jan 17, 2018 1:21 pm
by Rudolf
Wouldn't it save a reboot to add a restart of iptables to cron @reboot? Right after the files are copied.
That way the new rules become active right away.

Code: Select all

@reboot /etc/init.d/iptables restart
Flushing iptables: iptables.
Loading iptables settings: iptables.
Haven't tested myself, but it should do the trick.

Re: Updating toon without losing ssh access

Posted: Wed Jan 17, 2018 2:31 pm
by marcelr
There's no need. iptables is restarted at every reboot anyway.

Re: Updating toon without losing ssh access

Posted: Mon Jan 22, 2018 11:57 am
by jozg
Hello,

I've got something strange with my other toon.
That one is on firmware 4.9.23 and i want to update is.
So i removed the # from the VPN service in inittab, and the connection with the toon servers look connected.

But there is no update available.
On my other toon i'm used to, when i open the VPN, the update shows directly.
But on this one, after a day waiting, there is still nog update.

eneco-001-xxxxxx:/etc/opkg# vi base-feed.conf
src/gz base http://feed.hae.int/feeds/qb2/ene/4.10.6

I allready changed manually the feed (i've read that in a forum post) but still the update won't come.

Am i forgetting something?.

Thanks.

Regards,

Re: Updating toon without losing ssh access

Posted: Mon Jan 22, 2018 1:20 pm
by marcelr
In general, upgrades are pushed to all toons over a period of a few weeks. That you don't have it yet, doesn't mean anything. Exercise patience ...

Re: Updating toon without losing ssh access

Posted: Thu Feb 01, 2018 9:14 pm
by wbmk
hi marcelr,

could you help me updating my toon?

i followed the manual for updating without losing ssh access.

first i just now opened up the VPN again, so toon would check for an update. it found one.

got a bunch of files in the '/mnt/data/update' folder, so far so good.

tried to find the file 'base-qb2-ene_<whatever>_qb2.ipk'... found something similar: 'base-qb2-uni_4.11.6-1205-0_qb2.ipk'

tried to run the command: tar -zxvf base-qb2-uni_4.11.6-1205-0_qb2.ipk
but it throws me this error:

tar: invalid magic
tar: short read

Is it me, or did Quby change something so it would not be possible to keep SSH acces?

regards, wbmk

Re: Updating toon without losing ssh access

Posted: Thu Feb 01, 2018 9:32 pm
by michel30
Hello,

tar: invalid magic
tar: short read

That is after installing the new busybox-1.27.2-r2 I had the same problem.
I download the file to my MAC and edit it on there and that works super.

After I update the file but You will received error message that SHA does not match anymore so you need to force the installation.

There is an easy way to do a upgrade but fist you need to copy some files.

Code: Select all


1. Copy /etc/default/iptables.conf  to /root/iptables.conf

2. Copy /etc/passwd to /root/passwd

3. open Crontab (Crontab -e) and enter the following

@reboot cp /root/iptables.conf /etc/default/iptables.conf
@reboot cp /root/passwd /etc/passwd

4. set up the VPN connection 

5. reboot Toon

6. update Toon in the menu 
At this point you will lose SSH access after the first reboot.

7. Reboot Toon again
SSH access will be restored.

8. Close the OpenVPN connection again.


Re: Updating toon without losing ssh access

Posted: Thu Feb 01, 2018 9:50 pm
by marcelr
wbmk wrote:
tried to find the file 'base-qb2-ene_<whatever>_qb2.ipk'... found something similar: 'base-qb2-uni_4.11.6-1205-0_qb2.ipk'

tried to run the command: tar -zxvf base-qb2-uni_4.11.6-1205-0_qb2.ipk
but it throws me this error:

tar: invalid magic
tar: short read

Is it me, or did Quby change something so it would not be possible to keep SSH acces?

regards, wbmk
The new base-qb2 package no longer is a tar.gz package, but a Debian install package. opkg can handle both types. I'm not sure on what type of machine you can work, certainly toon has no tools to unpack this type, other than through opkg itself. But that will install the package, and that's not what you want. The method proposed by a.o. michel030 works, but if you have access to a linux box or mac, you can still unpack the .ipk using the archive management tools available on those machines. Ark is known to work, but a combination of ar and guzip will do the trick as well. After editing, you can then package everything again as a "normal" tar.gz, with extension .ipk and continue the installation.
I think Quby are moving more and more towards this type of package, since opkg developers have dropped support for .tar.gz-style packages ages ago.

Re: Updating toon without losing ssh access

Posted: Thu Feb 01, 2018 10:08 pm
by marcelr
Actually, at least the new busybox holds ar as one of its featured archivers. Over the weekend, I will try and make a small script that does the iptables.conf patching with a single command, so you can do it on toon directly.
Saves a lot of hassle.

Re: Updating toon without losing ssh access

Posted: Thu Feb 01, 2018 10:52 pm
by wbmk
Ooh, wow.. that would be great..

will wait a bit for that.. thnx a lot.

Re: Updating toon without losing ssh access

Posted: Sun Feb 04, 2018 7:36 pm
by marcelr
I just uploaded a small script to patch the base-qb2-<whatever>.ipk package with a single command.
You can find it here:
http://files.domoticaforum.eu/uploads/T ... ch_base.sh

It's been tested on 4.10.6, with busybox 1.27.2-r2 (the one with getty reinstated).
Copy onto toon, and chmod 755 patch_base.sh
Without any arguments, it will give you a (very short) usage note.
For now, more modern, Debian-style packages will be transformed into tarballs, since ar as part of busybox doesn't know how to archive. It can only extract. These transformed packages can be installed manually.

(with opkg install base-qb2-<whatever>.ipk )


Enjoy.

Re: Updating toon without losing ssh access

Posted: Sat Mar 03, 2018 11:51 am
by hayman
hallo,
i olso followed the manual for updating without losing ssh access.
and haven't seen the update on software ,try this ((sh upgrade-qb2.sh qb2 ene 4.11.6 execute-resume))
got alot of new files in root Map, on the (upgrade-qb2.sh.log) ik see the error

[ 2018-03-03 09:16:26 +0000 (pid 1205) prepared
>> 2018-03-03 09:16:26 +0000 (pid 1205) exit-0 upgrade-qb2.sh qb2 ene 4.10.6 prepare

>> 2018-03-03 09:31:58 +0000 (pid 1236) upgrade-qb2.sh qb2 ene 4.11.6 execute-resume

>> 2018-03-03 09:31:58 +0000 (pid 1236) execute-resume
>> Overriding HCB_FLAV to uni!
>> 2018-03-03 09:31:58 +0000 (pid 1236) executing
>> Logging "Upgrading application software from version '3.2.18' to 'qb2/uni/4.11.6'." to 99_DEBUG.log.json
>> Sending InitiatePreExit to hcb_config.
>> Detected execute-resume, notifying the user via framebuffer.
Showing /usr/share/images/image-nl-start.fb.gz
>>> fbLinePrint: Aborted software update to version 4.11.6 detected.
>>> fbLinePrint: Resuming update, please wait... do NOT turn off your display during the update.
>> Spawned /tmp/update.status.vars watcher with PID 1304
>> opkg remove base-qb2-ene
Removing package base-qb2-ene from root...
>> opkg --cache /root install base-qb2-uni tenant-eneco-nl
Unknown package 'base-qb2-uni'.
Installing tenant-eneco-nl (1.14-master) to root...
Copying /root/tenant-eneco-nl_1.14-master_all.ipk.
//usr/lib/opkg/info/tenant-eneco-nl.postinst: line 2: qmf-tenantize.sh: not found
Configuring tenant-eneco-nl.
Collected errors:
* opkg_install_cmd: Cannot install package base-qb2-uni.
>> 2018-03-03 09:32:11 +0000 (pid 1236) execute-resume-error-opkg-upgrade-flav-install 'Exit code 255 for opkg flav install']


please any help