Howto update to 01.01

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

Howto update to 01.01

Postby CloneNum3 » Wed Jan 07, 2015 8:58 pm

NOTE: Verified to still work in 01.01 on 7/2/2015.
NOTE: Tested on updater 00.10 and root 01.02 unreleased firmware versions, the process still worked, but may change before production release.

Following these instructions recovered my hub from the Wink.com snafu telling customers to ship the hub in for repair. After re-adding the hub into my iPhone app, it came back online Solid Blue. At no point in time did I have to use the alternate DNS address.

Skip to Step#4 if your hub is already rooted with SSH connectivity.

Code: Select all

[root@flex-dvt database]# cd /database; for i in `ls cf_*`; do echo -n "$i "; cat $i; done
cf_build 00.01
cf_fver0 00.01
cf_fver1 00.08
cf_fver2 00.01
cf_fver3 01.01
[root@flex-dvt database]#


Option #1 [ Try this first, only works on older hubs that did not come pre-updated to 00.89 or greater ]
#### 1. Add SSH key through curl -d command ###

Code: Select all

curl "http://192.168.0.1/set_dev_value.php" -d "nodeId=a&attrId=;mkdir /root/.ssh; echo ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA2nCGCGeaPSWseFqi/ctWeamK56qlBmIcr0L9K0ZaAq43BHfITtLL7mteZMJYSn8PX3JMKNFJiCvvSW8gla2s4aBqb9F1EjazDKJnWKyzzdgEeUqr0T7t2pltvxxoZ/z/wEVMB5AKD9TjjTXRSoEBF7AJ/OfhjKHQiO5TLWPlUtk= rsa_1024_no-plus >> /root/.ssh/authorized_keys;"


#### 2. Connect via SSH

Code: Select all

curl "http://192.168.0.1/index.php" -d '{"ssid":"myssid","pass":"mypassword"}'


#### 3. re-connect via dhcp address ###

Option #2 [ *** AT YOUR OWN RISK ***: Requires a USB to TTL Serial adapter ]
#### 1. Disassemble by removing the four screws

#### 2. Short pin# 29 on the NAND chip to any ground (any of the shields should work)

#### 3. Add "init=/bin/sh" as a kernel argument

NOTE: See http://www.rootwink.com/viewtopic.php?f=6&t=67 for more detailed instructions

#### At this point, you should already have ssh capability as root.

#### 4. Update the updater filesystem to 00.08

Code: Select all

touch /database/ENABLE_SSH
cp /root/.ssh/authorized_keys /database/authorized_keys
sed -i 's/reboot/#reboot/g' /root/platform/*.sh
cp /var/www/set_dev_value.php /database/set_dev_value.php # Save for later
/root/platform/upgrade.sh


NOTE: As of this post, I have never seen the hub-updates.winkapp.com respond. It is normal for it to fail connecting to hub-updates.winkapp.com and continue on to the alternate url of wink-hub-images.s3.amazonaws.com

#### 5. root the 00.05 update partition

Code: Select all

ubiattach -p /dev/mtd2
mkdir /tmp/updater
mount -t ubifs ubi2:rootfs /tmp/updater
sed -i 's/reboot/#reboot/g' /tmp/updater/root/platform/*.sh
cp -r /root/.ssh /tmp/updater/root/
chmod 655 /tmp/updater/root/.ssh
chmod 644 /tmp/updater/root/.ssh/authorized_keys
rm -f /tmp/updater/etc/init.d/S99local
touch /tmp/updater/database_default/ENABLE_SSH
cp /database/authorized_keys /tmp/updater/database_default/
cp /database/set_dev_value.php /tmp/updater/var/www/set_dev_value.php # re-enables the http hack we first used to root
rm -f /tmp/updater/etc/default/dropbear # remove DROPBEAR_ARGS=-sg which disables password logins and for root too
reboot


#### 6. Reboot ####

#Verify you are booted into the updater-rootfs by making sure mtd2 (not mtd5) is being attached to ubi0

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


#Proceed with rooting the gpmi-nfc-general-use main filesystem

Code: Select all

sed -i 's/reboot/#reboot/g' /root/platform/*.sh # just to be safe, should already be done
/root/platform/upgrade.sh


#Update process should spew out something similar to the following.

Code: Select all

[root@flex-dvt ~]# /root/platform/upgrade.sh
+ echo 'Press enter to cancel update...'
Press enter to cancel update...
+ read -t2 stdin
+ '[' 1 = 0 ']'
+ set_rgb 100 100 0 0 0 0 flash 250000
+ source /root/platform/platform.sh
++ set -x
+++ mount
+++ grep database
++ dbcheck='ubi1:database on /database type ubifs (rw,relatime)'
++ '[' '' == 'ubi1:database on /database type ubifs (rw,relatime)' ']'
+++ cat /proc/cmdline
+++ grep badapp
++ kernel_cmd_line=
++ '[' '' '!=' '' ']'
+++ grep badupdater
+++ cat /proc/cmdline
++ kernel_cmd_line=
++ '[' '' '!=' '' ']'
++ source /root/platform/platform.config
+++ SCRIPT_VERSION=UPDATE
+++ sw_pkg_url=https://hub-updates.winkapp.com
+++ alt_pkg_url=https://wink-hub-images.s3.amazonaws.com
++++ cat /database/cf_url
cat: can't open '/database/cf_url': No such file or directory
+++ eval tmp=
++++ tmp=
+++ '[' '' '!=' '' ']'
++++ cat /database/cf_build
+++ eval build=00.01
++++ build=00.01
+++ '[' 00.01 '!=' '' ']'
+++ board_id=00.01
+++ sw_pkg_url=https://hub-updates.winkapp.com/00.01
+++ alt_pkg_url=https://wink-hub-images.s3.amazonaws.com/00.01
+++ group_id=0
+++ fparts=4
+++ ntpserver1=0.rhel.pool.ntp.org
+++ ntpserver2=1.rhel.pool.ntp.org
+++ '[' UPDATE '!=' APP ']'
+++ canupdate[0]=1
+++ canupdate[1]=1
+++ upgrade_boot=1
+++ app_boot=1
+++ num_bootloaders=2
+++ eth_dev=wlan0
+++ eth_timeout=60
+++ ntpd_retry=3
+++ curl_args='--cacert /etc/ssl/certs/ca-certificates.crt --retry 5'
+ forced_update=0
+ (( idx=0  ))
+ (( idx<fparts  ))
+ flash_get 'fver[0]' cf_fver0
++ cat /database/cf_fver0
+ eval 'fver[0]=00.01'
++ fver[0]=00.01
+ '[' 0 '!=' 0 ']'
+ [[ 00.01 != [0-9][0-9].[0-9][0-9] ]]
+ '[' 00.01 = 00.00 ']'
+ (( idx++  ))
+ (( idx<fparts  ))
+ flash_get 'fver[1]' cf_fver1
++ cat /database/cf_fver1
+ eval 'fver[1]=00.05'
++ fver[1]=00.05
+ '[' 0 '!=' 0 ']'
+ [[ 00.05 != [0-9][0-9].[0-9][0-9] ]]
+ '[' 00.05 = 00.00 ']'
+ (( idx++  ))
+ (( idx<fparts  ))
+ flash_get 'fver[2]' cf_fver2
++ cat /database/cf_fver2
+ eval 'fver[2]=00.01'
++ fver[2]=00.01
+ '[' 0 '!=' 0 ']'
+ [[ 00.01 != [0-9][0-9].[0-9][0-9] ]]
+ '[' 00.01 = 00.00 ']'
+ (( idx++  ))
+ (( idx<fparts  ))
+ flash_get 'fver[3]' cf_fver3
++ cat /database/cf_fver3
+ eval 'fver[3]=00.55'
++ fver[3]=00.55
+ '[' 0 '!=' 0 ']'
+ [[ 00.55 != [0-9][0-9].[0-9][0-9] ]]
+ '[' 00.55 = 00.00 ']'
+ (( idx++  ))
+ (( idx<fparts  ))
+ cd /tmp
+ '[' '!' -d temp ']'
+ mkdir /tmp/temp
+ rm -rf /tmp/temp/upgrade_00.01.txt
+ wait_on_network
++ ifconfig
++ grep wlan0
+ tmp='wlan0     Link encap:Ethernet  HWaddr B4:79:A7:0D:60:3F  '
+ '[' '' == 'wlan0     Link encap:Ethernet  HWaddr B4:79:A7:0D:60:3F  ' ']'
+ (( idx=0  ))
+ (( idx<60 ))
+ sleep 1
++ grep 'inet addr'
++ ifconfig wlan0
+ tmp='          inet addr:192.168.41.164  Bcast:192.168.41.255  Mask:255.255.255.0'
+ '[' '' '!=' '          inet addr:192.168.41.164  Bcast:192.168.41.255  Mask:255.255.255.0' ']'
+ return 0
+ '[' 0 '!=' 0 ']'
+ set_date
+ (( idx=0  ))
+ (( idx<3 ))
++ date
++ grep 1970
+ datecheck=
+ '[' '' '!=' '' ']'
+ return 0
+ '[' 0 '!=' 0 ']'
+ get_update_config
++ grep Content-Length
++ curl --cacert /etc/ssl/certs/ca-certificates.crt --retry 5 -I https://hub-updates.winkapp.com/00.01/upgrade_00.01.txt
++ awk '{print $2}'
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'
+ file_len=
+ '[' '' = '' ']'
+ echo 'Could not open https://hub-updates.winkapp.com/00.01'
Could not open https://hub-updates.winkapp.com/00.01
++ grep Content-Length
++ awk '{print $2}'
++ curl --cacert /etc/ssl/certs/ca-certificates.crt --retry 5 -I https://wink-hub-images.s3.amazonaws.com/00.01/upgrade_00.01.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   575    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
+ file_len=575
+ '[' '' = 575 ']'
+ curl --cacert /etc/ssl/certs/ca-certificates.crt --retry 5 https://wink-hub-images.s3.amazonaws.com/00.01/upgrade_00.01.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   575  100   575    0     0   1657      0 --:--:-- --:--:-- --:--:--  1774
+ return 0
+ '[' 0 '!=' 0 ']'
++ cat /tmp/temp/upgrade_00.01.txt
++ grep board_id
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_board_id=00.01
++ grep group_id
++ cat /tmp/temp/upgrade_00.01.txt
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_group_id=0
+ '[' 0 = '' ']'
+ let 'read_group_id = 0'
++ awk -F = '{print $2}'
++ tr -d '\r'
++ cat /tmp/temp/upgrade_00.01.txt
++ grep sw_pkg_url
+ read_sw_pkg_url=https://wink-hub-images.s3.amazonaws.com/00.01
++ cat /tmp/temp/upgrade_00.01.txt
++ grep alt_pkg_url
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_alt_pkg_url=https://hub-updates.winkapp.com/00.01
++ cat /tmp/temp/upgrade_00.01.txt
++ grep fparts
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_fparts=4
+ '[' 4 = '' -o 4 = 0 ']'
+ let 'read_fparts = 4'
+ (( idx=0  ))
+ (( idx<read_fparts  ))
++ cat /tmp/temp/upgrade_00.01.txt
++ grep fdest0
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_fdest[$idx]=/dev/mtd1
++ grep fver0
++ cat /tmp/temp/upgrade_00.01.txt
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_fver[$idx]=00.01
+ [[ 00.01 != [0-9][0-9].[0-9][0-9] ]]
++ cat /tmp/temp/upgrade_00.01.txt
++ grep foff0
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_foff[$idx]=0
++ cat /tmp/temp/upgrade_00.01.txt
++ grep ftype0
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_ftype[$idx]=0
++ grep fsrc0
++ awk -F = '{print $2}'
++ cat /tmp/temp/upgrade_00.01.txt
++ tr -d '\r'
+ read_fsrc[$idx]=updater-uImage
++ grep md5sum0
++ cat /tmp/temp/upgrade_00.01.txt
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_md5sum[$idx]=11b29593183c2b94a85b333c03a3b52c
+ (( idx++  ))
+ (( idx<read_fparts  ))
++ cat /tmp/temp/upgrade_00.01.txt
++ awk -F = '{print $2}'
++ grep fdest1
++ tr -d '\r'
+ read_fdest[$idx]=/dev/mtd2
++ awk -F = '{print $2}'
++ tr -d '\r'
++ cat /tmp/temp/upgrade_00.01.txt
++ grep fver1
+ read_fver[$idx]=00.05
+ [[ 00.05 != [0-9][0-9].[0-9][0-9] ]]
++ cat /tmp/temp/upgrade_00.01.txt
++ grep foff1
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_foff[$idx]=0
++ grep ftype1
++ cat /tmp/temp/upgrade_00.01.txt
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_ftype[$idx]=1
++ cat /tmp/temp/upgrade_00.01.txt
++ grep fsrc1
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_fsrc[$idx]=updater-rootfs.ubi
++ grep md5sum1
++ cat /tmp/temp/upgrade_00.01.txt
++ tr -d '\r'
++ awk -F = '{print $2}'
+ read_md5sum[$idx]=3b454483039b456ede6d0dbf019ec2c2
+ (( idx++  ))
+ (( idx<read_fparts  ))
++ cat /tmp/temp/upgrade_00.01.txt
++ grep fdest2
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_fdest[$idx]=/dev/mtd4
++ cat /tmp/temp/upgrade_00.01.txt
++ grep fver2
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_fver[$idx]=00.01
+ [[ 00.01 != [0-9][0-9].[0-9][0-9] ]]
++ cat /tmp/temp/upgrade_00.01.txt
++ grep foff2
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_foff[$idx]=0
++ cat /tmp/temp/upgrade_00.01.txt
++ grep ftype2
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_ftype[$idx]=0
++ cat /tmp/temp/upgrade_00.01.txt
++ grep fsrc2
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_fsrc[$idx]=app-uImage
++ awk -F = '{print $2}'
++ tr -d '\r'
++ cat /tmp/temp/upgrade_00.01.txt
++ grep md5sum2
+ read_md5sum[$idx]=11b29593183c2b94a85b333c03a3b52c
+ (( idx++  ))
+ (( idx<read_fparts  ))
++ grep fdest3
++ awk -F = '{print $2}'
++ cat /tmp/temp/upgrade_00.01.txt
++ tr -d '\r'
+ read_fdest[$idx]=/dev/mtd5
++ grep fver3
++ awk -F = '{print $2}'
++ cat /tmp/temp/upgrade_00.01.txt
++ tr -d '\r'
+ read_fver[$idx]=00.56
+ [[ 00.56 != [0-9][0-9].[0-9][0-9] ]]
++ awk -F = '{print $2}'
++ tr -d '\r'
++ cat /tmp/temp/upgrade_00.01.txt
++ grep foff3
+ read_foff[$idx]=0
++ grep ftype3
++ awk -F = '{print $2}'
++ tr -d '\r'
++ cat /tmp/temp/upgrade_00.01.txt
+ read_ftype[$idx]=1
++ grep fsrc3
++ awk -F = '{print $2}'
++ cat /tmp/temp/upgrade_00.01.txt
++ tr -d '\r'
+ read_fsrc[$idx]=app-rootfs.ubi
++ grep md5sum3
++ cat /tmp/temp/upgrade_00.01.txt
++ awk -F = '{print $2}'
++ tr -d '\r'
+ read_md5sum[$idx]=4be9449d6830538084393c0fd5483b85
+ (( idx++  ))
+ (( idx<read_fparts  ))
+ cleanup_update_config
+ rm -rf /tmp/temp
+ '[' 00.01 = 00.01 ']'
+ echo 'Board Ids Match...'
Board Ids Match...
+ '[' 0 -le 0 -o 1 = 0 ']'
+ echo 'Group Ids Pass...'
Group Ids Pass...
+ check_versions
+ didupdate=0
+ (( idx=0  ))
+ (( idx<num_bootloaders  ))
+ '[' 00.01 '>' 00.01 ']'
+ (( idx++  ))
+ (( idx<num_bootloaders  ))
+ '[' 00.05 '>' 00.05 ']'
+ (( idx++  ))
+ (( idx<num_bootloaders  ))
+ '[' UPDATE '!=' APP ']'
+ '[' 1 = 0 ']'
+ (( idx=num_bootloaders  ))
+ (( idx<read_fparts  ))
+ '[' 00.01 '>' 00.01 ']'
+ (( idx++  ))
+ (( idx<read_fparts  ))
+ '[' 00.56 '>' 00.55 ']'
+ '[' UPDATE '!=' APP ']'
+ do_update
+ '[' '' = '' ']'
+ update_func=update1
+ declare -f update1
+ '[' 0 = 0 ']'
+ set_rgb 100 0 0 0 0 0 flash 250000
+ update1
+ success_url=https://wink-hub-images.s3.amazonaws.com/00.01/app-rootfs.ubi
++ curl --cacert /etc/ssl/certs/ca-certificates.crt --retry 5 -I https://wink-hub-images.s3.amazonaws.com/00.01/app-rootfs.ubi
++ grep Content-Length
++ awk '{print $2}'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 24.5M    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
+ file_len=25690112
+ '[' '' = 25690112 ']'
+ md5pipe /tmp/test.md5
+ ubiformat /dev/mtd5 -y -f - -S 25690112
+ curl --cacert /etc/ssl/certs/ca-certificates.crt --retry 5 https://wink-hub-images.s3.amazonaws.com/00.01/app-rootfs.ubi
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 71 -- 11 % complete  rentd   Time    Time     Time  Cur
libscan: scanning eraseblock 72 -- 11 % complete       Dload  Upload   Total   Spent    Left  Speed
libscan: scanning eraseblock 615 -- 100 % complete  -:--:--  0:05:57 7463157 0
ubiformat: 616 eraseblocks have valid erase counter, mean value is 9
100 24.5M  100 24.5M    0     0   660k      0  0:00:38  0:00:38 --:--:--  559k

ubiformat: formatting eraseblock 615 -- 100 % complete 
+ '[' 0 '!=' 0 ']'
+ sync
+ sync
+ sync
+ sleep 1
++ cat /tmp/test.md5
+ md5_check=4be9449d6830538084393c0fd5483b85
+ '[' 4be9449d6830538084393c0fd5483b85 '!=' 4be9449d6830538084393c0fd5483b85 ']'
+ flash_set cf_fver3 00.56
+ echo 00.56
+ didupdate=1
+ (( idx++  ))
+ (( idx<read_fparts  ))
+ '[' UPDATE '!=' APP ']'
+ set_boot_application
+ flash_set DO_UPDATE 0
+ echo 1
+ set_rgb 0 200 0 0 0 0 flash 500000
+ end 0
+ echo END
END
+ '[' 0 = 1 ']'
+ '[' UPDATE '!=' APP ']'
+ sleep 5
+ exit 0
[root@flex-dvt ~]#


# Now your main gpmi-nfc-general-use filesystem is updated (00.56 in the case of the above), now to root it BEFORE we reboot.

Code: Select all

ubiattach -p /dev/mtd5
mkdir /tmp/rootfs
mount -t ubifs ubi2:rootfs /tmp/rootfs

touch /tmp/rootfs/database_default/ENABLE_SSH
touch /database/ENABLE_SSH #should already exist
touch /database_default/ENABLE_SSH  #should already exist
cp /database/authorized_keys /tmp/rootfs/database_default/
cp -r /root/.ssh /tmp/rootfs/root/ # this is necessary
chmod 655 /tmp/rootfs/root/.ssh
chmod 644 /tmp/rootfs/root/.ssh/authorized_keys
sed -i 's/reboot/#reboot/g' /tmp/rootfs/root/platform/*.sh
sed -i 's/^#tty/tty/g' /tmp/rootfs/etc/inittab # this is necessary to re-enable the serial console
cp /database/set_dev_value.php /tmp/rootfs/var/www/set_dev_value.php # re-enables the http hack we first used to root
rm -f /tmp/rootfs/etc/default/dropbear # removes the "DROPBEAR_ARGS=-sg" arguments preventing logins with passwords and root logins

#### 7. Reboot ####
Cross fingers.

Note: If your hub blinks purple and does not connect, re-add it via the Wink app on your device.

zimler
Posts: 1
Joined: Sat Jan 10, 2015 5:32 pm

Re: Work in Progress - Howto

Postby zimler » Sat Jan 10, 2015 5:44 pm

Hi - Thanks for throwing this together. Just running through this and noticed something.

#### root the 00.05 update partition
ubiattach -p /dev/mtd2
mkdir /tmp/updater
mount -t ubifs ubi2:rootfs /tmp/updater
sed -i 's/reboot/#reboot/g' /tmp/updater/root/platform/*sh <==== should there be a dot between the star and "sh"?
cp -r /root/.ssh /tmp/updater/root/
chmod 655 /tmp/updater/root/.ssh
chmod 644 /tmp/updater/root/.ssh/authorized_keys
rm -f /tmp/updater/etc/init.d/S99local
touch /tmp/updater/database_default/ENABLE_SSH
cp /database/authorized_keys /tmp/updater/database_default/
reboot

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

Re: Work in Progress - Howto

Postby CloneNum3 » Mon Jan 12, 2015 8:57 am

should there be a dot between the star and "sh"?


It actually doesn't matter... there are no other files in that directory ending in sh so with or without the dot, it will have the same result. I did however add the dot to my post for consistency sake.

winker
Posts: 7
Joined: Fri Jan 16, 2015 5:14 pm

Re: Work in Progress - Howto

Postby winker » Fri Jan 16, 2015 5:25 pm

CloneNum3 wrote:rm -f /tmp/rootfs/etc/default/dropbear



Hi,
Thanks for all the help. Saw this forum from the XDA forum.

Why do you delete dropbear? Some of the other tutorials do not delete dropbear.

http://slickdeals.net/forums/showpost.p ... tcount=220

Just wondering what the difference is, or maybe they're doing something different to accomplish the same thing?

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

Re: Work in Progress - Howto

Postby comp3v » Thu Jan 22, 2015 12:44 am

I tried to follow these steps, but on running /root/platform/upgrade.sh I get errors:
cat: can't open '/database/cf_url': No such file or directory
cat: can't open '/database/cf_fver0': No such file or directory
No valid version for part 0, set to 00.00
cat: can't open '/database/cf_fver1': No such file or directory
No valid version for part 1, set to 00.00
cat: can't open '/database/cf_fver2': No such file or directory
No valid version for part 2, set to 00.00
cat: can't open '/database/cf_fver3': No such file or directory
No valid version for part 3, set to 00.00
- etc. Any ideas of what could be wrong here?

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

Re: Work in Progress - Howto

Postby CloneNum3 » Thu Jan 22, 2015 9:03 pm

winker wrote:
CloneNum3 wrote:rm -f /tmp/rootfs/etc/default/dropbear



Hi,
Thanks for all the help. Saw this forum from the XDA forum.

Why do you delete dropbear? Some of the other tutorials do not delete dropbear.

http://slickdeals.net/forums/showpost.p ... tcount=220

Just wondering what the difference is, or maybe they're doing something different to accomplish the same thing?


I delete that specific file... all it contains are additional arguments to dropbear (sshd) which prevent ssh logins without a password. In newer firmware versions (I think 00.47 through at least 00.55, the password is blank, that file will prevent you from logging in with a blank password) Removing this file allows you to login as root with no password even if you don't have a working public key in place.

The actual dropbear program is /usr/sbin/dropbear, and that should NOT be deleted.

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

Re: Work in Progress - Howto

Postby CloneNum3 » Thu Jan 22, 2015 9:05 pm

comp3v wrote:I tried to follow these steps, but on running /root/platform/upgrade.sh I get errors:
cat: can't open '/database/cf_url': No such file or directory
cat: can't open '/database/cf_fver0': No such file or directory
No valid version for part 0, set to 00.00
cat: can't open '/database/cf_fver1': No such file or directory
No valid version for part 1, set to 00.00
cat: can't open '/database/cf_fver2': No such file or directory
No valid version for part 2, set to 00.00
cat: can't open '/database/cf_fver3': No such file or directory
No valid version for part 3, set to 00.00
- etc. Any ideas of what could be wrong here?


If you are at version 00.01 right now, those files may not exist yet. If you let the upgrade continue, it should be fine.

In short, I think that's normal.

All those files contain are the current versions of the kernel and os of both the update and root os... here are mine, I'm running update 00.05 and os 00.55

Code: Select all

[root@flex-dvt ~]# for i in `find /database | grep cf_`
> do
> echo $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.55

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

Re: Work in Progress - Howto

Postby comp3v » Sat Jan 24, 2015 1:10 pm

UPD. Update worked fine after I've unblocked hub-updates.winkapp.com and wink-hub-images.s3.amazonaws.com at my /etc/hosts.
At the same time, one remaining question: when my phone's app says an update is available and suggests to apply it - I should not accept it as it can "unroot" the device - am I right?

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

Re: Work in Progress - Howto

Postby CloneNum3 » Sat Jan 24, 2015 3:17 pm

comp3v wrote:UPD. Update worked fine after I've unblocked hub-updates.winkapp.com and wink-hub-images.s3.amazonaws.com at my /etc/hosts.
At the same time, one remaining question: when my phone's app says an update is available and suggests to apply it - I should not accept it as it can "unroot" the device - am I right?


That is correct... if you let it update without taking the appropriate steps to preserve root, updating via the phone app will unroot your device.

The phone update process will...
  • update the updater filesystem if necessary
  • reboot to updater filesystem
  • update root filesystem
  • reboot to standard filesystem

There are numerous ways to go about preserving root. The way I do it is commenting out all the "reboot" commands in the update process. That way, I can...
  • update the updater filesystem if necessary
  • before reboot, comment out the reboot from the update process in the updater filesystem and delete the S99local preventing the update from starting automatically at boot
  • reboot to updater filesystem
  • verify reboots are commented out from the update process
  • update root filesystem
  • re-enable the serial console, delete the /etc/default/dropbear from the standard boot preventing root logins with now password, verify /database/ENABLE_SSH still exists
  • reboot to standard filesystem

The hub should still be rooted.

Jonesie
Posts: 23
Joined: Sat Feb 14, 2015 11:22 am

Re: Work in Progress - Howto

Postby Jonesie » Sat Feb 14, 2015 11:27 am

Hello, and thank you for the awesome info on rooting this device. I have rooted my hub fresh out of the box, and I'm working to upgrade it while maintaining root, following this post by copying/pasting, so as to avoid typos.

I have gotten to the following step, and I'm getting an error:

Code: Select all

[root@flex-dvt database]# ubiattach -p /dev/mtd5
ubiattach: error!: cannot attach "/dev/mtd5"
           error 17 (File exists)


Based on Google results, I figured you guys would ask for this info, so I'm including it in an effort to be proactive about requesting help. :)

Code: Select all

[root@flex-dvt ]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00300000 00020000 "gpmi-nfc-0-boot"
mtd1: 00400000 00020000 "updater-kernel"
mtd2: 01c00000 00020000 "updater-rootfs"
mtd3: 00800000 00020000 "database"
mtd4: 00800000 00020000 "app-kernel"
mtd5: 04d00000 00020000 "gpmi-nfc-general-use"


Any assistance you could provide would be appreciated.

Thanks - Jonesie


Return to “Upgrade to current firmware maintaining root”

Who is online

Users browsing this forum: No registered users and 2 guests