Updating to Latest

ptmuldoon
Posts: 14
Joined: Thu Mar 19, 2015 8:54 pm

Updating to Latest

Postby ptmuldoon » Thu Mar 19, 2015 9:01 pm

I have a new Wink Hub that I rooted out of the box before it took any updates. As far I know, everything went correctly, and I can SSH into the Hub and was able to get the Hub connected to the App.

Now of course, it wants to update. I'm pretty sure I am sitting at version 0.01.

I'm pretty certain the current Wink version is 0.77 now. Will following these same steps still keep me rooted?

CloneNum3
Site Admin
Posts: 107
Joined: Wed Jan 07, 2015 10:02 am

Re: Updating to Latest

Postby CloneNum3 » Fri Apr 03, 2015 12:38 am

I will have to try... I haven't dealt with 0.77 yet

OuTTaRiCe
Posts: 4
Joined: Sat Jan 24, 2015 11:52 am

Re: Updating to Latest

Postby OuTTaRiCe » Sat Apr 04, 2015 5:33 pm

upgade steps for 0.56 still works for 0.77.
The main noticeable difference in the 0.77, updater-rootfs have been updated and set_dev_value.php has been removed.

comp3v
Posts: 7
Joined: Thu Jan 22, 2015 12:37 am

lost root upon upgrading to the last (00.82) version

Postby comp3v » Sun Apr 12, 2015 1:53 am

I tried to update my (previously rooted) hub using the instructions.
First, I should note that I already had 00.56 version at that moment, but I still tried to repeat all instructions from the very first line - maybe it was bad idea...
Here is what I had:

Code: Select all

[root@flex-dvt ]# for i in `find /database/cf* -type f`; do echo -n "$i="; cat $i; done
/database/cf_build=00.01
/database/cf_fver0=00.01
/database/cf_fver1=00.05
/database/cf_fver2=00.01
/database/cf_fver3=00.56
[root@flex-dvt ]# dmesg | grep ubi0
Kernel command line: noinitrd console=ttyAM0,115200 rootfstype=ubifs ubi.mtd=5 root=ubi0:rootfs rw gpmi
UBI: attaching mtd5 to ubi0
UBI: attached mtd5 to ubi0
[root@flex-dvt ]# touch /database/ENABLE_SSH
[root@flex-dvt ]# cp /root/.ssh/authorized_keys /database/authorized_keys
[root@flex-dvt ]# sed -i 's/reboot/#reboot/g' /root/platform/*.sh
[root@flex-dvt ]# /root/platform/upgrade.sh
Press enter to cancel update...
cat: can't open '/database/cf_url': No such file or directory
Warning: Transient problem: timeout Will retry in 1 seconds. 5 retries left.
Warning: Transient problem: timeout Will retry in 2 seconds. 4 retries left.
Warning: Transient problem: timeout Will retry in 4 seconds. 3 retries left.
Warning: Transient problem: timeout Will retry in 8 seconds. 2 retries left.
Warning: Transient problem: timeout Will retry in 16 seconds. 1 retries left.
curl: (6) Couldn't resolve host 'hub-updates.winkapp.com'
Could not open https://hub-updates.winkapp.com/00.01
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   575    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   575  100   575    0     0    117      0  0:00:04  0:00:04 --:--:--   166
Board Ids Match...
Group Ids Pass...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 20.6M    0     0    0     0      0      0 --:--:--  0:00:09 --:--:--     0
ubiformat: mtd2 (nand), size 29360128 bytes (28.0 MiB), 224 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 223 -- 100 % complete
ubiformat: 223 eraseblocks have valid erase counter, mean value is 1
ubiformat: 1 eraseblocks are supposedly empty
ubiformat: flashing eraseblock 0 --  0 % complete    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20.6M  100 20.6M    0     0  80482      0  0:04:28  0:04:28 --:--:--  128k

ubiformat: formatting eraseblock 223 -- 100 % complete
END
[root@flex-dvt ]# ubiattach -p /dev/mtd2
UBI device number 2, total 224 LEBs (28442624 bytes, 27.1 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[root@flex-dvt ]# mkdir /tmp/updater
[root@flex-dvt ]# mount -t ubifs ubi2:rootfs /tmp/updater
[root@flex-dvt ]# sed -i 's/reboot/#reboot/g' /tmp/updater/root/platform/*.sh
[root@flex-dvt ]# cp -r /root/.ssh /tmp/updater/root/
[root@flex-dvt ]# chmod 655 /tmp/updater/root/.ssh
[root@flex-dvt ]# chmod 644 /tmp/updater/root/.ssh/authorized_keys
[root@flex-dvt ]# rm -f /tmp/updater/etc/init.d/S99local
[root@flex-dvt ]# touch /tmp/updater/database_default/ENABLE_SSH
[root@flex-dvt ]# cp /database/authorized_keys /tmp/updater/database_default/
[root@flex-dvt ]# reboot

Then, after reboot:

Code: Select all

[root@flex-dvt ~]# dmesg | grep ubi0
Kernel command line: noinitrd console=ttyAM0,115200 rootfstype=ubifs ubi.mtd=2 root=ubi0:rootfs rw gpmi
UBI: attaching mtd2 to ubi0
UBI: attached mtd2 to ubi0
[root@flex-dvt ~]# sed -i 's/reboot/#reboot/g' /root/platform/*.sh # just to be safe, should already be done
[root@flex-dvt ~]# /root/platform/upgrade.sh
Press enter to cancel update...
script_version: UPDATE
cat: can't open '/database/cf_url': No such file or directory
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   575    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   575  100   575    0     0    246      0  0:00:02  0:00:02 --:--:--   313
Board Ids Match...
Group Ids Pass...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 24.6M    0     0    0     0      0      0 --:--:--  0:00:14 --:--:--     0
ubiformat: mtd5 (nand), size 80740352 bytes (77.0 MiB), 616 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 615 -- 100 % complete
ubiformat: 616 eraseblocks have valid erase counter, mean value is 17
ubiformat: flashing eraseblock 0 --  0 % complete    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24.6M  100 24.6M    0     0  59747      0  0:07:12  0:07:12 --:--:--  102k

ubiformat: formatting eraseblock 615 -- 100 % complete
END
[root@flex-dvt ~]# ubiattach -p /dev/mtd5
UBI device number 2, total 616 LEBs (78217216 bytes, 74.6 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[root@flex-dvt ~]# mkdir /tmp/rootfs
[root@flex-dvt ~]# mount -t ubifs ubi2:rootfs /tmp/rootfs
[root@flex-dvt ~]# touch /tmp/rootfs/database_default/ENABLE_SSH
[root@flex-dvt ~]# touch /database/ENABLE_SSH #should already exist
[root@flex-dvt ~]# touch /database_default/ENABLE_SSH  #should already exist
[root@flex-dvt ~]# cp /database/authorized_keys /tmp/rootfs/database_default/
[root@flex-dvt ~]# cp -r /root/.ssh /tmp/rootfs/root/ # this is necessary
[root@flex-dvt ~]# sed -i 's/reboot/#reboot/g' /tmp/rootfs/root/platform/*.sh
[root@flex-dvt ~]# sed -i 's/^#tty/tty/g' /tmp/rootfs/etc/inittab # this is necessary to re-enable the serial console
[root@flex-dvt ~]# cp /var/www/set_dev_value.php /tmp/rootfs/var/www/set_dev_value.php # re-enables the http hack we first used to root
cp: can't stat '/var/www/set_dev_value.php': No such file or directory

When I noticed that set_dev_value.php was not there anymore (I tried with `find` starting from root directory - the file was not found at all), I re-created it manually and continued:

Code: Select all

[root@flex-dvt www]# cp /var/www/set_dev_value*.php /tmp/rootfs/var/www/
[root@flex-dvt ]# for i in `find /database/cf* -type f`; do echo -n "$i="; cat $i; done
/database/cf_build=00.01
/database/cf_fver0=00.01
/database/cf_fver1=00.08
/database/cf_fver2=00.01
/database/cf_fver3=00.82
[root@flex-dvt ]# reboot

After this reboot, I am not able to connect to the hub anymore :( The hub itself works, keeping all the devices previously connected, Wink apps works as well etc. - but no SSH or other access; curl gives "curl: (7) Failed connect to 192.168.1.4:80; No error"...
Any ideas?

deeproot
Posts: 2
Joined: Fri Mar 06, 2015 11:25 pm

Re: Updating to Latest

Postby deeproot » Tue Apr 14, 2015 11:35 pm

if you goto your http://yourwinkip/set_dev_value.php does it still work? if so you can just cat a ssh pub key in and get back to ssh shell.


Return to “Upgrade to current firmware maintaining root”

Who is online

Users browsing this forum: No registered users and 1 guest