# Install required software for the build (Ubuntu): sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind lib32readline5-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev # Install repo: cd ~ mkdir bin curl http://android.git.kernel.org/repo >~/bin/repo chmod a+x ~/bin/repo PATH="$HOME/bin:$PATH" # Get the android source: export DIR=/opt/aosp mkdir -p $DIR cd $DIR repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo repo sync # Get the android kernel: git clone git://android.git.kernel.org/kernel/msm.git -b android-msm-2.6.32 # Apply the patches (http://www.cl.cam.ac.uk/research/dtg/android/mock/patches.tar): cp ~/patches.tar $DIR tar xvf patches.tar find . | egrep "([0-9]{4})(.*)\.patch\$" | egrep -v "external" | sort | while read PATCH; do cd `dirname "$PATCH"`; git am --3way `basename "$PATCH"`; cd $DIR; done # At this point you may have to fix conflicts - the patches apply cleanly to a tree from late August 2010 # Grab the kernel config from the Nexus One (must be plugged in at this point): cd $DIR/msm adb pull /proc/config.gz gunzip -f config.gz && mv config .config # Build the kernel: make ARCH=arm CROSS_COMPILE=$DIR/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- oldconfig make -j4 ARCH=arm CROSS_COMPILE=$DIR/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- # Place the kernel in the Android build: cd $DIR rm device/htc/passion-common/bcm4329.ko ln -s $DIR/msm/drivers/net/wireless/bcm4329.ko device/htc/passion-common/bcm4329.ko rm device/htc/passion-common/kernel ln -s $DIR/msm/arch/arm/boot/zImage device/htc/passion-common/kernel # Configure the build: . build/envsetup.sh lunch full_passion-userdebug # Grab proprietrary drivers from the Nexus One: cd device/htc/passion ./extract-files.sh # Build Android (takes a while!): cd $DIR make # Flash build to a device: fastboot flashall # Create update.zip (optional): cd $DIR/out/target/product/passion && mkupdate