Ansuel / tch-nginx-gui

Modified file to apply to a stock technicolor GUI
GNU General Public License v3.0
340 stars 52 forks source link

[TG789vac v2] Bricked updating from 9.4.70-184d06d3 to last stable version #1096

Closed gianluca-pub-dev closed 2 years ago

gianluca-pub-dev commented 2 years ago

Device Model/Firmware: TG789vac v2 (VANT-6) GUI Version: 9.4.70-184d06d3

Description of problem: I updated the GUI using the procedure indicated in https://github.com/Ansuel/tch-nginx-gui/issues/921 but the upgrade script failed after reboot step. I waited for many minutes before to attempt to powercyle the router. Now at power on it seems to attempt 3 times to boot in a quick sequence, and then it remain with "info" led flashing, without booting.

Here are the console logs of the upgrade command:

` Product: vant-6 Release: Aqua (16.3) Version: 16.3.7636-2921002-20170419153951-718b590506a915e24be58946f4755c0c617d9c8d

Hash config: 718b590506a915e24be58946f4755c0c617d9c8d Hash openwrt: 6c42ccd019341602a510e4984926f77957cec937 Hash kernel: 0fbe1548eadea50c295b8b839aee7a52668c8325 Hash packages: 0f8aa1264d7a3bf6e4304f0f8ddfdabc4ddac7e4 Hash technicolor: 12432aba3b37fe3a9fda3bd9cc4e8da3fa5fbb40 Hash routing: 7b853f235ce96cd14f3abaebf9253c5ca7f72f7d Hash lte: 91e34310893a4c4e7a9093cd3866924c285deb6b Hash custo: 27310c4b16dc4c0fbdfc8d2591680dc10a609083 Hash mindspeed: 91b6a7a4d703268d6023c3a58da3d33fc62e7ed8

Bootloader: 2.0.85

root@OpenWrt:/tmp# curl -k https://raw.githubusercontent.com/Ansuel/gui-dev-buil d-auto/master/GUI.tar.bz2 --output /tmp/GUI.tar.bz2 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 3200k 100 3200k 0 0 1463k 0 0:00:02 0:00:02 --:--:-- 1494k root@OpenWrt:/tmp# bzcat /tmp/GUI.tar.bz2 | tar -C / -xvf - && /etc/init.d/rootdevice debug etc/ etc/wansensing/ etc/wansensing/L2Main.lua etc/nginx/ etc/nginx/naxsi_core.rules etc/nginx/mime.types etc/nginx/koi-win etc/nginx/fastcgi_params

--------------cut--------------------

www/info-cards/003_connected_device.lp www/info-cards/005_mmpbxd_stats.lp www/info-cards/001_gateway.lp Root Script Saving hashed root password in uci if modified... Root Script Shadow contains different pass than saved one. Save it! Root Script Checking and force-enabling dropbear SSH Server for root on lan Root Script Restarting Dropbear SSH Server... Root Script OBP sanity check FAILED start autoplanning... Root Script Cloning to bank_2 and checking checksum... Unlocking /dev/mtd4 ...

Writing from /dev/mtd3 to /dev/mtd4 ... Root Script Cloning complete, moving to bank_2 overlay... Root Script Moving /overlay/bank_1 to /overlay/bank_2... Root Script Activating and erasing bank_1... Root Script Installation will continue after reboot... /etc/rc.common: line 1: can't create /proc/prozone/bootfail: nonexistent directory /etc/rc.common: line 1: can't create /proc/prozone/bootcounter: nonexistent directory /etc/rc.common: line 1: can't create /proc/prozone/bootbank: nonexistent directory Unlocking bank_1 ... Erasing bank_1 ... Rebooting ... ` What option do I have to unbrick it?

FrancYescO commented 2 years ago

use TFTP, probably you didn't wait enought time after reboot before powercicle

https://hack-technicolor.readthedocs.io/en/latest/Recovery/#set-up-tftp

gianluca-pub-dev commented 2 years ago

Hi @FrancYescO,

more than half an hour is not enough? I recovered the router using TFTP, and now bank_2 content is as was left by the update script. I can contribute to investigate the issue using the logs that I already reported here and the current bank_2 content if the project is interested. This is a real issue imho, maybe depending from updating from an old version (9.4.70).

Regards

FrancYescO commented 2 years ago

put here logs from /overlay/modgui* folder if any

unfortunately these are pretty hard to reproduce ad debug, as i'm pretty sure if you retry the installation will be a success

gianluca-pub-dev commented 2 years ago

this is the current list of folders in /overlay/bank_2

root@OpenWrt:~# ls -laF /overlay/bank_2/ drwxr-xr-x 11 root root 0 Jul 13 05:51 ./ drwxr-xr-x 5 root root 0 Jan 1 1970 ../ drwxr-xr-x 3 root root 0 Apr 19 2017 cgroups/ drwxr-xr-x 21 root root 0 Jul 22 21:26 etc/ drwxr-xr-x 3 root root 0 Apr 19 2017 home/ drwxr-xr-x 4 root root 0 Jul 22 21:26 lib/ drwxr-xr-x 3 root root 0 Apr 19 2017 mnt/ -rw-r--r-- 1 root root 0 Jul 13 05:51 null drwxr-xr-x 3 root root 0 Jul 22 21:28 root/ drwxr-xr-x 2 root root 0 Jul 22 21:26 sbin/ drwxr-xr-x 6 root root 0 Dec 16 2020 usr/ drwxr-xr-x 10 root root 0 Dec 16 2020 www/

There is no modgui folder at the top. I recognize the /overlay/bank_2/etc/config files as the ones used before the brick.

FrancYescO commented 2 years ago

not in /overlay/bank2 but /overlay/modgui....

gianluca-pub-dev commented 2 years ago

nothing like that:

root@OpenWrt:~# ls -laF /overlay/ drwxr-xr-x 5 root root 0 Jan 1 1970 ./ drwxr-xr-x 1 root root 0 Apr 19 2017 ../ lrwxrwxrwx 1 root root 1 Apr 19 2017 .fs_state -> 2 drwxr-xr-x 8 root root 0 Apr 19 2017 bank_1/ drwxr-xr-x 11 root root 0 Jul 13 05:51 bank_2/

overlay is mounted from mtdblock2: /dev/mtdblock2 on /overlay type jffs2 (rw,relatime,compr=zlib)

maybe was mtdblock2 erased with factory reset? After the TFTP recovery I had to do it since the original firmware was not working (login not landing to any page)

So I performed: factory reset root it again to access ssh

gianluca-pub-dev commented 2 years ago

Update script was reporting: Root Script Installation will continue after reboot... /etc/rc.common: line 1: can't create /proc/prozone/bootfail: nonexistent directory /etc/rc.common: line 1: can't create /proc/prozone/bootcounter: nonexistent directory /etc/rc.common: line 1: can't create /proc/prozone/bootbank: nonexistent directory

I see here that the script checks for /proc/prozone folder existency, then it assume the the 3 proc virtual files exist: https://github.com/Ansuel/tch-nginx-gui/blob/89342d7b7383adfdb99f87c2b11be3d376cfd9d3/decompressed/base/etc/init.d/rootdevice#L297

I have checked now with stock firmware that the 3 proc files doesn't exist with Tiscali version (kernel/bootp different configuration?): root@OpenWrt:~# ls -laF /proc/prozone/ dr-xr-xr-x 2 root root 0 Jul 24 17:35 ./ dr-xr-xr-x 126 root root 0 Jan 1 1970 ../ -rw-r--r-- 1 root root 0 Jul 24 17:35 bootp -rw-r--r-- 1 root root 0 Jul 24 17:35 reboot

Can this be the issue?

CC: @Ansuel

FrancYescO commented 2 years ago

No. We already know these are missing on some devices/firmwares

are just needed to speedup the reboot, not an issue if missing.