Home | History | Annotate | Download | only in docs
      1 HOW TO REBUILT THE ANDROID EMULATOR-SPECIFIC KERNEL:
      2 ====================================================
      3 
      4 I. Helper script:
      5 -----------------
      6 
      7 We now provide a helper script to rebuild the kernel,
      8 it is under distrib/rebuild-kernel.sh.
      9 
     10 You need the sources in android.git.kernel.org/kernel/qemu.git,
     11 in branch origin/android-goldfish-2.6.29
     12 
     13 To rebuild the ARMv5TE kernel:
     14 
     15   cd $KERNEL_SOURCES
     16   /path/to/rebuild-kernel.sh --out=$ANDROID/prebuilt/android-arm/kernel
     17 
     18 To rebuild the ARMv7-A one:
     19 
     20   cd $KERNEL_SOURCES
     21   /path/to/rebuild-kernel.sh --armv7 --out=$ANDROID/prebuilt/android-arm/kernel
     22 
     23 To rebuild the x86 kernel:
     24 
     25   cd $KERNEL_SOURCES
     26   /path/to/rebuild-kernel.sh --arch=x86 --out=$ANDROID/prebuilt/android-x86/kernel
     27 
     28 Note that you will need to have your cross-toolchain in your path.
     29 If this is not the case, the script will complain and give you the
     30 expected name. Use --cross=<prefix> to specify a different toolchain.
     31 
     32 See rebuild-kernel.sh --help for more options and details.
     33 
     34 
     35 II. Rebuilding from scratch:
     36 ----------------------------
     37 
     38 If you don't or can't use the script, here are manual instructions:
     39 
     40 You need to have the Android toolchain in your path
     41 (i.e. 'arm-eabi-gcc --version' must work)
     42 
     43 then:
     44 
     45 git clone git://android.git.kernel.org/kernel/common.git kernel-common
     46 cd kernel-common
     47 git checkout origin/archive/android-gldfish-2.6.29
     48 
     49 export CROSS_COMPILE=arm-eabi-
     50 export ARCH=arm
     51 export SUBARCH=arm
     52 make goldfish_defconfig    # configure the kernel
     53 make -j2                   # build it
     54 
     55 => this generates a file named arch/arm/boot/zImage
     56 
     57 NOTE: Branch android-goldfish-2.6.27 is obsolete now. Do not use it.
     58 
     59 Now, you can use it with:
     60 
     61   emulator -kernel path/to/your/new/zImage <other-options>
     62 
     63 
     64 You can build an ARMv7-compatible kernel image by using goldfish_armv7_defconfg
     65 in the above instructions (instead of goldfish_defconfig). Note that you will
     66 need to enable ARMv7 emulation by using the -cpu cortex-a8 option, as in:
     67 
     68   emulator -kernel path/to/your/new/zImage <other-options> -qemu -cpu cortex-a8
     69 
     70 As a special convenience, if the name of your kernel image ends in -armv7, then
     71 the emulator binary will automatically enable ARMv7 emulation for you, so doing
     72 the following should be equivalent
     73 
     74   emulator -kernel path/to/your/kernel-armv7 <other-options>
     75 
     76 
     77 Voila !
     78