After nearly two years on a custom built Android OS, it was time to upgrade. I now have the latest (4.0.4) Replication build for Galaxy Nexus running.
Before installing, I went through a few extra flashes, just to make sure everything would go smoothly. I started out with putting back the original factory images, provided by Google. Download, unpack, and run the included script flash-all.sh. That was up and running within a minute or two.
Next, I tried CyanogenMod’s build for Galaxy Nexus, including the ClockworkMod Recovery boot image. I used the touch image found here, and simply flashed with:
fastboot flash recovery recovery-clockwork-touch-22.214.171.124-maguro.img
I used the cm-10.1.2-maguro.zip from here, and followed the installation procedure using the recovery image seen here. The only difference was that I had to boot the phone fully to have access through adb. Pushing the zip file while in recovery mode did not seem to work. Besides that, everything went smooth. It’s probably worth noting that the camera still works with the CM 10.1.2 build.
So far, so good. Now for the Replicant images. I downloaded the 4.0 0004 build. The instructions suggests the Heimdall recovery image for installation, but I tried to flash through fastboot instead. Thus the install went something like this, while the phone was on the bootloader screen (not in recovery mode).
sudo fastboot erase boot
sudo fastboot erase userdata
sudo fastboot flash boot boot.img
sudo fastboot flash recovery recovery.img
sudo fastboot flash system system.img
sudo fastboot flash userdata userdata.img
sudo fastboot reboot
That worked fine. Replicant booted, and it all looks good. Note that the recovery image which came with the Replicant build was an older version of the ClockworkMod, without touch. So, following the CM install steps above, I could have skipped that. But it doesn’t make a big difference.
The only problem with the Replicant image is that it does not contain a free version of the firmware drivers for things like WiFi and camera, and thus they don’t ship the proprietary binary blobs either. Now, that might be what you want, however, I choice to include the wifi binaries. I copied the ones from the CyanogenMod build. It went something like this:
First remount /system writeable
mount -o rw,remount -t ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/system /system
Back on the terminal on the host computer, I extracted the firmware files, and copied them over. And then a reboot.
unzip -x cm-10.1.2-maguro.zip system/vendor/firmware/*
adb push system/vendor/firmware /system/vendor/firmware
The last bit was to reinstall the various packages and configurations. For .apk files, they can easily be installed with adb. Then the configuration can be copied over. Just make sure the copied files get the same owner and group as its application. For some applications, like httpmon, this was easy. However, for K-9 it got a bit messy since the chown and chgrp commands are somewhat lacking. The later can operate recursively, but you still need to use both.
adb install Gibberbot-37.apk
adb install httpmon-27.apk
adb push org.jtb.httpmon /data/data/org.jtb.httpmon
The Replicant distribution comes with the FOSS app market F-Droid pre-installed, so that’s convenient. That market includes applications like Firefox K-9 Mail, Gibberbot, APV PDF Viewer, httpmon, Orbot, Orweb. (It turned out that Firefox for ARM6 had to be downloaded from here).