[Galaxy S Plus I9001 Android Development] Xistance:
As requested by many people I decided to make this guide. Unfortunately I want everyone to know that you HAVE to do this in Linux(Ubuntu 12.04 in this case). You could do this in Cygwin but you have to look for other guides for that as I have never used it and don't know much about it.

Happy building~~!

Requirements

64bit Ubuntu

Python 2.4--2.7

sudo apt-get install python

Git 1.7 or newer

sudo apt-get install git-core

Installing Android SDK

Download the SDK here: http://developer.android.com/sdk/index.html

Extract the SDK and place it in your home directory.

I renamed my SDK to android-sdk to make it easier to navigate to.

Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.

Add these lines at the bottom of the file(Change path according to your SDK dir):

# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin

Find your .profile file and add this at the bottom of the file:

PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"

Check for updates by entering this in terminal:

android

Install required packages(12.04)

sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 lib32ncurses5-dev x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

Toolchain and Source

Open your terminal and type :

mkdir android
cd android
mkdir kernel

Type this to get your toolchains. I used the linaro toolchain in my kernel using DooMLoRD's great prebuilt toolchains.

git clone git://github.com/DooMLoRD/android_prebuilt_toolchains.git toolchains

Git clone your kernel repo of choice into android/kernel. I shall use arco's 3.0.x kernel repo as reference.

git clone git://github.com/arco/samsung-kernel-msm7x30.git -b ics-3.0

Building The Kernel

Part A. Pre-build Steps

A. Open terminal and change to the root of your kernel directory

B. Type "export ARCH=arm"

C. Type "export CROSS_COMPILE=~/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-"

Part B. The First Build

A. Type "make ariesve_defconfig"

B. Type "make menuconfig" and make the required changes to use any modules you added or similar changes.

C. Type "make -j<maximum number of jobs>"

Part C. Re-Builds

A. Type "make clean"

B. Type "make oldconfig"

C. Type "make -j<maximum number of jobs>"

Part D. Building Modules

You have two options:

A. Type "make modules"

B. Type "make path/to/your/module.ko"

Explanation of all parts :

Part A.(These steps are required every time you close your terminal and re-open it to build again.)

A. Ok shouldn’t need to explain this.

B. This command sets your target architecture.

C. Defines the path to the toolchain we are going to use to compile our kernel. You can change this to point towards whatever toolchain you have downloaded or feel like using, the way it is currently configured it will use the Linaro toolchain that we downloaded above.

Part B.(These only need to be run the first time you build a kernel.)

A. Load's your configuration file.

B. Open up a menu to configure your kernel. It will use the config file you loaded in the previous step as a base.

C. Viola start the build. I typically allow 1 job per core, so on my quad core machine I put "make -j5". Just raising that number will not make your build faster, your processor needs to be able to support the number of jobs you are assigning it.

Part C. (Use the command's when you are building any-time outside of the first)

A. This command gets rid of any old/outdated binaries or modules you compiled before, and let's start fresh. I like to run it every time I build unless my changes are really small and localized.

B. A very awesome command, it parses through what has changed and only prompts you about new options.

C. See the explanation for the above "Part C.".

Part D.(Use these for just building kernel modules.)

A. This will re-build all modules.

B. Will rebuild just the module you need. Very useful when you need to rebuild a WiFi module.

Making the boot.img

Make sure that you got the .ko files that were listed when your kernel got built. These are the modules like the WiFi module that are needed. If you didn't really take notice of where those files are and just want to do it a bit more easily you can use these commands(thanks to Recognized Dev Hacre)

A. Open a terminal
B. Change to your root kernel directory
C. Type "mkdir ../<your_kernel>_output"
D. Type "cp arch/arm/boot/zImage ../<your_kernel>_output/zImage"
E. Type "find . -name "*.ko" -exec cp {} ../<your_kernel>_output \;"

Normally we would need to do many stuff with mkbootimg but this utility by koush is much easier for you guys. Later on try to learn the normal way though :). http://xdaforums.com/showthread.php?t=748106

After flashing the kernel to your device and it boots properly you can now use "adb push" to push the earlier .ko files to system/lib/modules/. Of course, make sure your device is plugged in and has adb debugging on. For example:

adb push dhd.ko system/lib/modules/dhd.ko

Andddd that is it :). Pretty easy really even if it might be a bit time consuming. Kernels aren't really an expertise of mine so I probably won't be able to help much but please ask any questions you might need below with your error in a pastebin link ^_^.

Credits:

arco68 for his source

ivendor also for the source

thewadegeek for his kernel tutorial I based on

DooMLoRD for his toolchain

Everyone who requested this tutorial :)

This tutorial was based off of thewadegeek's tutorial : http://xdaforums.com/showthread.php?t=1748297