DeprecatedBuildAndroid » History » Revision 25
Revision 24 (Denis 'GNUtoo' Carikli, 09/29/2009 08:43 PM) → Revision 25/34 (Aaron Williamson -, 09/30/2009 09:47 PM)
Edit: We have now a temporary git repository at gitorious: http://gitorious.org/replicant == Before starting == * Root root your phone * Backup your current system!!! * Install git == Setting up Setup the build environment and getting source code system == These instructions assume Let's say that you are building replicant in your home our build directory (~). If you are building it in another directory, modify path names accordingly. is ~/replicant === Get Check out the repo tool === Dream Android repository : repo is a front-end to git which is used to manage several git repositories. {{{ mkdir bin cd bin wget http://android.git.kernel.org/repo chmod a+x repo cd .. }}} === Check out the Replicant repository === This step will download the Android source (minus the kernel) and the Replicant patches. {{{ mkdir replicant cd replicant ../bin/repo init -u git://gitorious.org/replicant/manifest.git ../bin/repo sync }}} == Optional: building the kernel and wireless LAN driver == By default, the Android build system uses a pre-compiled kernel and wireless driver rather than compiling these components from scratch. If you want to compile your own copy of either of these components, you have to compile both: the wireless driver sources included with Android are incompatible with the pre-compiled kernel. === Get the kernel source === To download the kernel sources, create a file in your replicant/.repo directory called "local_manifest.xml" containing the following: {{{ <?xml version="1.0" encoding="UTF-8"?> <manifest> <project path="kernel" name="kernel/msm" revision="refs/heads/android-msm-2.6.27"/> </manifest> }}} Then from the ~/replicant/ directory, run: {{{ ../bin/repo sync }}} This will create a directory called replicant/kernel and download the kernel sources to it. === Build the kernel === To build the kernel: {{{ cd ~/replicant/kernel export ARCH=arm export CROSS_COMPILE=arm-eabi- export PATH=$PATH:~/replicant/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin cp arch/arm/configs/msm_defconfig .config make oldconfig && make }}} Wait several hours. === Point the build system to your kernel === Create a file called `~/replicant/buildspec.mk` containing the following: {{{ TARGET_PRODUCT:=htc_dream TARGET_PREBUILT_KERNEL:=kernel/arch/arm/boot/zImage }}} This will instruct the build process to use your kernel rather than the pre-compiled kernel. === Build the wifi module === To build the wifi module: {{{ cd ~/replicant/system/wlan/ti/sta_dk_4_0_4_32 export KERNEL_DIR=~/replicant/kernel/ make }}} (If make can't find your compiler, re-run same PATH export command you ran before compiling the kernel.) Replace the pre-built wifi module with the one you just built: {{{ cp wlan.ko ~/replicant/vendor/htc/dream-open }}} == Build the firmware == === Change the build scripts to include some important missing packages === ''(This section will be removed once these changes are committed to the replicant repository)'' Open the file {{{~/replicant/vendor/htc/dream-open/htc_dream.mk}}} and at the following text to the beginning of the file: {{{ PRODUCT_PACKAGES := \ Calculator \ Email \ ImProvider \ SdkSetup \ VoiceDialer }}} This will include packages in the build which would otherwise be missing (including the SdkSetup package, which will enable incoming calls). {{{ cd ~/replicant make }}} Wait and wait and wait. == Each time you want to build something == * open a new console * Then type: {{{ cd ~/replicant export ANDROID_JAVA_HOME=$JAVA_HOME lunch htc_dream-eng make }}} * The files to flash are in ~/replicant/out/target/product/dream,flash them and then clear the cache * boot and push the wifi firmware if you want it == If you want to build a particular project == * open a new console * build everything if it was not done before * Then type: {{{ cd ~/replicant source build/envsetup.sh export ANDROID_JAVA_HOME=$JAVA_HOME lunch htc_dream-eng #go into the directory containing an Android.mk mm }}} == Status == * ril works more or less: * * calls should work(in/out) * * sms should work(in/out) * * hearphones not supported * sound works even with headphones(beware calls's sound don't work with headphones)