Tuesday, July 13, 2010

Migrating from Android JF1.5 to CM6 (Froyo) on my G1/ADP1

My notes regarding my upgrade of Android 1.5 to 2.2 on my G1/ADP1. Also how I manually imported /data after failing to rerun my 1.5 OS.



Some links







Normal OS Upgrade


Before:

# rooted: yes
# fastboot capable: yes
# HBOOT-0.95.3000
# CPLD-4
# RADIO 2.22.19.26I



$ md5sum fastboot
9851bb6ad29cd4b60c9ba9d011ba9efd fastboot
$ ./fastboot devices
HT846GZ39709 fastboot
$ md5sum 2.2/recovery-RA-dream-v1.7.0.img
4b9f198aa8ada3ca1ed5537e9c25e427 2.2/recovery-RA-dream-v1.7.0.img


Boot in fast mode (BACK+HANG)

Plug USB


$ ./fastboot flash recovery 2.2/recovery-RA-dream-v1.7.0.img
sending 'recovery' (4594 KB)... FAILED (command write failed (Protocol error))
jerome@expresso2:~/Code/MyAndroid$ ./fastboot devices
???????????? fastboot


Ouch!

rebooted (CALL+MENU+HANG) and tried again


$ ./fastboot flash recovery 2.2/recovery-RA-dream-v1.7.0.img
sending 'recovery' (4594 KB)... OKAY
writing 'recovery'... OKAY

$ ./fastboot reboot
rebooting...



Nandroid

boot into recovery (HOME+HANG)

verify that Build is RA-dream-1.7.0


$ pushd /home/jerome/local/lib/nandroid-2.0/
jerome@expresso2:~/local/lib/nandroid-2.0$ ./nandroid.sh ~/Code/MyAndroid/backups/backup_20100712_1


boot normally


$ sha1sum 2.2/spl-signed.zip
34b26d57985a610f538633e6571d1847c8a4800b 2.2/spl-signed.zip


forgot to copy the CM rom onto the sdcard ... so added it while in recovery mode:

go to console
mount /sdcard


adb push 2.2/update-cm-6.0.0-DS-RC1-signed.zip /sdcard/


verify md5


Correct according to
http://code.google.com/p/sapphire-port-dream/downloads/detail?name=spl-signed.zip&can=2&q=


$ cp 2.2/spl-signed.zip /media/3436-3337/
jerome@expresso2:~/Code/MyAndroid$ md5sum 2.2/spl-signed.zip /media/3436-3337/spl-signed.zip
2112b7df6ed9d0a56897ac23b0399bb5 2.2/spl-signed.zip
2112b7df6ed9d0a56897ac23b0399bb5 /media/3436-3337/spl-signed.zip

$ cp 2.2/gapps-mdpi-FRF91-3-signed.zip /media/3436-3337/
jerome@expresso2:~/Code/MyAndroid$ md5sum 2.2/gapps-mdpi-FRF91-3-signed.zip /media/3436-3337/gapps-mdpi-FRF91-3-signed.zip
1f64c3ff2d6f3f7078185af216f550df 2.2/gapps-mdpi-FRF91-3-signed.zip
1f64c3ff2d6f3f7078185af216f550df /media/3436-3337/gapps-mdpi-FRF91-3-signed.zip


umount partition
turn off USB storage from G1
reboot into receovey

flashed spl-signed.zip

rebooted via home+back

G1 auto reboots into recovery mode and finish installing SPL

wipe data/factory reset


flashed

booted
OK

Welcome to Froyo ! Configure at will

Issues



Main problem was that applications are missing their data. (e.g. smses, etc).

So I tried to return to 1.5 from backup with intent to install Titanium backup or similar.

first wipe

second recover nandroid backup (I don't recover recovery.img)


./fastboot
./fastboot devices
./fastboot erase userdata
./fastboot erase cache
./fastboot flash boot backups/backup_20100712_1/boot.img
./fastboot flash system backups/backup_20100712_1/system.tar
./fastboot reboot


But this never worked...

Reinstalling apps and associated data manually



Prerequisites, have a data.tar somewhere from an android backup. Untar it.

Reinstalling the apps

ls -1 data/app/*.apk | xargs -l1 adb install


df -k /data on mobile vs du -sk on PC to verify there's enough space

backup as in you never know

tar cvf /sdcard/data.tar /data/data


Copy files and fix permissions.

adb push data/misc/wifi/wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf
chown system:wifi /data/misc/wifi/wpa_supplicant.conf
chmod 660 /data/misc/wifi/wpa_supplicant.conf

adb push data/data /data/data/

# http://wiki.cyanogenmod.com/index.php?title=Fix_permissions
/system/bin/fix_permissions


This takes a while..

Boots properly. Requires to enter gmail account ?!
Done.

Contacts didn't import properly. In logcat:

I/Gmail ( 1457): MainSyncRequestProto: lowestBkwdConvoId: 0, highestHandledServerOp: 701502, normalSync: true
D/Gmail ( 1457): IO exception: java.net.SocketTimeoutException: Read timed out
D/SyncManager( 112): failed sync operation authority: gmail-ls account: Account {name=jerome.lacoste@gmail.com, type=com.google} extras: [] syncSource: 0 when: 40290 expedited: false, SyncResult: stats [ numIoExceptions: 1]
I/Gmail ( 1457): MainSyncRequestProto: lowestBkwdConvoId: 0, highestHandledServerOp: 701502, normalSync: true
D/dalvikvm( 1457): GC_FOR_MALLOC freed 9193 objects / 451656 bytes in 102ms

I/ActivityManager( 112): Process com.google.android.gm (pid 1457) has died.


Moved some apps to sdcard to free some space. GMail sync started working

Fixed widgets

Fixed screens (going from 3 to 5 home screens end up shifting not centering my screens)

3 comments:

  1. So how is the phone behaving now? Faster? Froyo not too memory consuming for the G1? Tell us more! :)

    ReplyDelete
  2. I am still constrained by space. I am waiting for my new micro sd card (should arrive this week) to be able to move more stuff on the card itself and to benefit from speedup (e.g. taking pics)

    Phone behaves well and fast. A few strange stuff (can't find CamCorder app to link from desktop, same for Clock Alarm). Market works. So far so good.

    ReplyDelete
  3. Hi Jerome,

    Thank you very much for the "cookbook"! I learned some lessons from it and was able to successfully upgrade my ADP1 to CM6 (also from JF1.5, btw). Most importantly, YOU convinced me I should upgrade because it works :)

    Lessons learned:
    - Installed Titanium backup to backup apps & apps' data before doing upgrade. Most apps I restored so far (SMS, OI Safe, aCurrency ) work.
    - I was getting "Protocol error" while trying to flash recovery all the time and reboot did not help. Apparently, it was caused by a problem with particular USB port on my computer I connected my phone to. Using another port helped.
    - Google Maps are not included in CM6, so should be installed from the market. However, Google Maps are not available for my country (Ukraine). I had to install market-enabler app (http://code.google.com/p/market-enabler/) to fake US(T-Mobile) location.
    - Phone works noticeably faster, especially browser, but memory consumption seems higher as a couple a heavy apps cause home app being removed from the memory and reloaded when going back home.

    Thanks again!

    ReplyDelete