| || |
100% stock Captivate ROM from AOSP source
A little background information. I came from the iPhone world where the OS is 100% pure every time you install it and I guess I had become spoiled by that. I love the Android platform, don't get me wrong. I would never go back. But something I find disturbing is what we call "bloatware" or "crapware" and all the "value-added" bullcrap the carriers pre-install to our devices. My first goal was to write up a detailed HOWTO for de-crapifying my device, the AT&T Samsung Captivate. I did that and people had wonderful things to say about my HOWTO, but I was not satisfied. The only way to know my OS is pristine is to build it myself. So here started the research. I dug around, scoured forums, and posted questions in order to find answers and I have a lot of good information but I still need your help.
A friend of mine who develops Android apps pointed me to opensource.samsung.com and I was able to get the SGH-I897 files they've so generously provided the community.
Armed with the Samsung files and the knowledge I've picked up I've been able to create a somewhat working 2.1_r2 ROM for the Captivate.
My build platform is Ubuntu Lucid x86 and these are the instructions I've used to create my ROM:
--- start build instructions ---
## Directory tree
mkdir -p ~/android_build/mydroid
mkdir -p ~/android_build/samsung_files
## Install dev tools
* sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind
* cd ~
* mkdir bin
* curl xxxx://android.git.kernel.org/repo >~/bin/repo
* chmod a+x ~/bin/repo
## Install jdk 1.5.0_22
Search for sun jdk 1.5.0_22 in your browser and go to the Oracle site.
* Download jdk-1_5_0_22-linux-i586.bin
* chmod +x jdk-1_5_0_22-linux-i586.bin
* mkdir -p /usr/local/java
* cp -R jdk1.5.0_22 /usr/local/java
## Edit .bashrc
* Add to ~/.bashrc
* source ~/.bashrc
## Download Android source
* cd ~/android_build/mydroid
* repo init -u git://android.git.kernel.org/platform/manifest.git -b android-2.1_r2
* repo sync
## Download Samsung Files
I fear you will need a browser here.
Go to opensource.samsung.com
Click Mobile up top
Find and download SGH-I897_OpenSource.tar.gz
Copy SGH-I897_OpenSource.tar.gz to ~/android_build/samsung_files
## Uncompress Samsung files
tar xzvf SGH-I897_OpenSource.tar.gz
tar xvf Platform.tar
## Merge Samsung files
rsync -a --stats --progress dalvik/ ~/android_build/mydroid/dalvik/
rsync -a --stats --progress external/ ~/android_build/mydroid/external/
rsync -a --stats --progress prebuilt/ ~/android_build/mydroid/prebuilt/
rsync -a --stats --progress vendor/ ~/android_build/mydroid/vendor/
## Modify BoardConfig.mk
Edit ~/android_build/mydroid/build/target/board/generic/BoardConfig.mk and add the following lines:
BOARD_HAVE_BLUETOOTH := true
BT_USE_BTL_IF := true
BT_ALT_STACK := true
BRCM_BTL_INCLUDE_A2DP := true
BRCM_BT_USE_BTL_IF := true
## Compile the ROM
--- end build instructions ---
The ROM fired up perfectly in the emulator so I decided to put it on to my device, after performing a Nandroid backup of course. Here are the steps I used to install my new ROM.
1) From my Linux box, md5sum system.img > nandroid.md5
2) mkdir /mnt/captivate/clockworkmod/backup/Test
3) cp system.img /mnt/captivate/clockworkmod/backup/Test/
4) cp nandroid.md5 /mnt/captivate/clockworkmod/backup/Test/
5) Run CWM and Backup Current ROM
6) Run CWM and boot into recovery
7) From recovery mode, factory reset the device
8) From recovery mode, restore "Test"
9) From recovery mode, reboot!
The ROM actually booted up with the following issues:
1) No internet access. Most likely because I have not installed the radio's software? How and where do I get it?
2) The screen flickers like crazy. I am not sure why. In the Samsung directory there is an OpenGL archive. I should see if I can use that to fix screen issues.
3) Calendar crashes, this happens in the emulator too. adb logcat shows the calendar is trying to reach Google but the APIs are not installed. So I will need to modify system.img and inject all the Google-specific apks, libs, etc
4) The "Product" in Settings > About is "generic". How can I make that "SAMSUNG-SGH-I897"? Just change the environment variable?
I think with the help of the community I can make a nice plain vanilla ROM from source and from that point we can start to add in useful things.
I cannot post links or images yet so I will not include the emulator screens as planned.