Platform:
wind7_64 + ubuntu12_04_64 + VMware
Here take Android5.0 as an example:
Android5.0 can be downloaded here:
Android-5.0.tar.gz
115 Network Tray Gift Pack code: 5LBD7CRTK1WZ
Http://115.com/lb/5lbd7crtk1wz
Linux_source_goldfish can be downloaded here:
Android5.0 compilation can be referenced by:
Problems encountered
Http://www.cnblogs.com/pengdonglin137/p/4197969.html
Need to use OPENJDK7
apt-get install openjdk-7-jdkapt-get install openjdk-7-jre
Compile:
[Email protected]:~/work/android/android5/android-5.0# . build/envsetup.sh including device/moto/shamu/vendorsetup.shincluding Device/samsung/manta/vendorsetup.shincluding Device/generic/mini-emulator-x86/vendorsetup.shincluding Device/generic/mini-emulator-arm64/vendorsetup.shincluding Device/generic/mini-emulator-mips/vendorsetup.shincluding Device/generic/mini-emulator-x86_64/vendorsetup.shincluding Device/generic/mini-emulator-armv7-a-neon/vendorsetup.shincluding Device/lge/mako/vendorsetup.shincluding Device/lge/hammerhead/vendorsetup.shincluding Device/asus/tilapia/vendorsetup.shincluding Device/asus/deb/vendorsetup.shincluding Device/asus/grouper/vendorsetup.shincluding Device/asus/flo/vendorsetup.shincluding Device/asus/fugu/vendorsetup.shincluding SDK/bash_completion/Adb.bash[email protected]:~/work/android/android5/android-5.0# Choosecombo Build type choices is:1. Release2. Debugwhich would? [1]1which product would?[Full] Variant choices is:1. User2. Userdebug3. Engwhich would?[Eng]============================================Platform_version_codename=relplatform_version=5.0target_product=fulltarget_build_variant=Engtarget_build_type=Releasetarget_build_apps=Target_arch=armtarget_arch_variant=armv7-atarget_cpu_variant=Generictarget_2nd_arch=target_2nd_arch_variant=target_2nd_cpu_variant=Host_arch=X86_64host_os=Linuxhost_os_extra=linux-3.5.0- at-generic-x86_64-with-ubuntu-12.04-Precisehost_build_type=releasebuild_id=Lrx21mout_dir= out============================================[email protected]:~/work/android/android5/android-5.0# make
Once the compilation is complete, set the tool chain path, which is convenient for compiling the kernel:
Export path= $PATH:/root/work/android/android-5.0/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin
Compile kernel:
After downloading the kernel, unzip
[email protected]:~/work/android/android5/goldfish# git branch-a Master remotes /origin/head, Origin/master remotes /origin/ Android-3.10 remotes /origin/android-< Span style= "color: #800080;" >3.4 remotes /origin/android-goldfish- 2.6 . 29 remotes /origin/android-goldfish-3.10 remotes /origin/android-goldfish-3.4 Span style= "color: #000000;" > remotes /origin/linux-goldfish-3.0 - WIP remotes /origin/master
Since the kernel used by the Android5.0 simulator is 3.4 (you can start an emulator with the emulator's own kernel and then look at the kernel version cat/proc/version), we also use 3.4:
[Email protected]:~/work/android/android5/goldfish# git checkout remotes/origin/android-goldfish-3.4 -B linux-3.4
Then modify the Makefile
ARCH = armcross_compile ? = arm-eabi-
Configuring the Kernel
[Email protected]:~/work/android/android5/goldfish# make Goldfish_armv7_defconfig
Note: This default kernel does not configure the module load function, need to execute make menuconfig setting, otherwise cannot compile and load kernel module
Compiling the kernel
Make Zimage-j2
Start the emulator with our compiled kernel:
[Email protected]:~/work/android/android5/android-5.0# Emulator64-arm-kernel. /goldfish/arch/arm/boot/zimage
Android Linux Kernel compilation