Results 1 to 6 of 6
  1. Thread Author  Thread Author    #1  

    Default 100% stock Captivate ROM from AOSP source

    Hey guys,
    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
    * ./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
    export JAVA_HOME=/usr/local/java/jdk1.5.0_22/
    export ANDROID_JAVA_HOME=$JAVA_HOME
    export PATH=$PATH:~/bin:$JAVA_HOME/bin
    * 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
    cd ~/android_build/samsung_files
    tar xzvf SGH-I897_OpenSource.tar.gz
    tar xvf Platform.tar

    ## Merge Samsung files
    cd ~/android_build/samsung_files/Captivate_eclair
    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
    cd ~/android_build/mydroid
    make update-api
    make

    --- 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.
    Thanked by:
  2. #2  
    Cory Streater's Avatar
    Forums Emeritus

    Posts
    13,092 Posts
    Global Posts
    13,813 Global Posts

    Default

    This is great & welcome to the forums. I'll see if I can point some guys over your direction to help answer your questions.
  3. #3  

    Default

    Quote Originally Posted by gdanko View Post
    4) The "Product" in Settings > About is "generic". How can I make that "SAMSUNG-SGH-I897"? Just change the environment variable?
    I'm pretty sure for this one you need to edit the buildprop. it can be done with a simple note editing program. You should open up the build prop and do a search for "generic" and see what the results are.
    Thanked by:
  4. #4  
    Jerry Hildenbrand's Avatar
    AC Cowboy

    Posts
    5,341 Posts
    Global Posts
    5,819 Global Posts
    ROM
    Homebrewed

    Default

    Quote Originally Posted by gdanko View Post
    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.
    WooHoo! Nice work man. I'll toss out some ideas --
    1 - have you set the APN? Unless you purposely flashed something different for the radio (if it booted, you didn't ) it's still the same as it was before you loaded up the new ROM. And it has to be, all that is closed proprietary firmware.
    2 - compare the build.prop and /lib folders on your ROM to the stock shipping ROM for the Captivate. You will need all of Samsung's hardware libs, and a lot of graphics properties are set in the build.prop. You also might want to try Samsung's kernel and modules to see if that fixes anything, then compare your kernel config to stock.
    3 - . You're looking for hdpi, and I have the best luck with the ones from 9/27. These are all the Google apps and support libs, in a package to flash right over an AOSP ROM.
    4. Yep. Kevin has that one answered. Edit the build.prop and you'll be in business.

    Best of luck man! Pull this one off and you'll be a saviour to a lot of Captivate users
    (•‿•)
    Thanked by:
  5. #5  
    caliskimmer's Avatar
    Retired Moderator

    Posts
    1,891 Posts
    ROM
    N/A

    Default

    Dang, I wish I could help, but I've been using pre-made ROMs, so I can't assist you too much. But of course, our other mods are excellent, so you'll definitely have no shortage of answers from them.
  6. #6  

    Default

    First, congratulations on a successful build! I think you are better off posting this at forums.xda-developers.com, as more ROM builders check out those forums. Here's my 2 cents:

    1) No internet access.

    You need an apn-conf.xml file. Goes in /system/etc I think (not at my main comp right now).

    2) The screen flickers like crazy.

    You need to pull proprietary drivers from the phone into your build. Again, I can post on how to do this later. Even have to do this on the Nexus One.

    3) Calendar crashes...

    like someone already posted, get the gapps package from goo-inside.me (it's legit!)

    4) The "Product" in Settings > About is "generic". How can I make that "SAMSUNG-SGH-I897"? Just change the environment variable?

    Samsung just tells you to copy their mods into the "generic" product config. Again, easy to fix but difficult to explain quickly. Bottom line, you have to make a "vendor" for your product.

Posting Permissions