blob: 46a0b44e1478d45335dd0316c140cd9b075ca607 [file] [log] [blame]
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -08001HOW TO REBUILT THE ANDROID EMULATOR-SPECIFIC KERNEL:
2====================================================
3
David 'Digit' Turner5c25d3d2011-03-05 00:20:16 +01004I. Helper script:
5-----------------
6
7We now provide a helper script to rebuild the kernel,
8it is under distrib/rebuild-kernel.sh.
9
SeongJae Park98499882013-03-26 11:35:47 +090010You need the sources in android.googlesource.com/kernel/goldfish.git,
David 'Digit' Turner21f55a82011-10-04 20:07:58 +020011in branch origin/android-goldfish-2.6.29
David 'Digit' Turner5c25d3d2011-03-05 00:20:16 +010012
David 'Digit' Turner21f55a82011-10-04 20:07:58 +020013To rebuild the ARMv5TE kernel:
David 'Digit' Turner5c25d3d2011-03-05 00:20:16 +010014
15 cd $KERNEL_SOURCES
16 /path/to/rebuild-kernel.sh --out=$ANDROID/prebuilt/android-arm/kernel
17
David 'Digit' Turner21f55a82011-10-04 20:07:58 +020018To rebuild the ARMv7-A one:
19
20 cd $KERNEL_SOURCES
21 /path/to/rebuild-kernel.sh --armv7 --out=$ANDROID/prebuilt/android-arm/kernel
22
David 'Digit' Turner5c25d3d2011-03-05 00:20:16 +010023To rebuild the x86 kernel:
24
25 cd $KERNEL_SOURCES
26 /path/to/rebuild-kernel.sh --arch=x86 --out=$ANDROID/prebuilt/android-x86/kernel
27
Bhanu Chetlapalli88f828e2012-05-21 16:39:51 -070028To rebuild the MIPS kernel:
29
30 cd $KERNEL_SOURCES
31 /path/to/rebuild-kernel.sh --arch=mips --out=$ANDROID/prebuilts/qemu-kernel/mips
32
David 'Digit' Turner5c25d3d2011-03-05 00:20:16 +010033Note that you will need to have your cross-toolchain in your path.
34If this is not the case, the script will complain and give you the
35expected name. Use --cross=<prefix> to specify a different toolchain.
36
37See rebuild-kernel.sh --help for more options and details.
38
39
40II. Rebuilding from scratch:
41----------------------------
42
43If you don't or can't use the script, here are manual instructions:
44
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080045You need to have the Android toolchain in your path
46(i.e. 'arm-eabi-gcc --version' must work)
47
48then:
49
SeongJae Park98499882013-03-26 11:35:47 +090050git clone https://android.googlesource.com/kernel/goldfish.git kernel-goldfish
51cd kernel-goldfish
52git checkout origin/android-gldfish-2.6.29
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080053
54export CROSS_COMPILE=arm-eabi-
55export ARCH=arm
56export SUBARCH=arm
57make goldfish_defconfig # configure the kernel
58make -j2 # build it
59
60=> this generates a file named arch/arm/boot/zImage
61
David 'Digit' Turner18d7ef72010-08-24 09:13:31 -070062NOTE: Branch android-goldfish-2.6.27 is obsolete now. Do not use it.
63
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080064Now, you can use it with:
65
66 emulator -kernel path/to/your/new/zImage <other-options>
67
David 'Digit' Turner18d7ef72010-08-24 09:13:31 -070068
69You can build an ARMv7-compatible kernel image by using goldfish_armv7_defconfg
70in the above instructions (instead of goldfish_defconfig). Note that you will
71need to enable ARMv7 emulation by using the -cpu cortex-a8 option, as in:
72
73 emulator -kernel path/to/your/new/zImage <other-options> -qemu -cpu cortex-a8
74
75As a special convenience, if the name of your kernel image ends in -armv7, then
76the emulator binary will automatically enable ARMv7 emulation for you, so doing
77the following should be equivalent
78
79 emulator -kernel path/to/your/kernel-armv7 <other-options>
80
81
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080082Voila !