Platform:
wind7_64 + ubuntu12_04_64 + VMware
Here take Android5.0 as an example:
Android5.0 can be downloaded here:
115 Network Tray Gift Pack code: 5LBD7CRTK1WZ
Http://115.com/lb/5lbd7crtk1wz
Linux_source_goldfish can be downloaded here:
115 Network Tray Gift Pack code: 5lbd76rru5or
Http://115.com/lb/5lbd76rru5or
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 you like? [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-3.4 remotes/origin/ android-goldfish-2.6. in remotes/origin/android-goldfish-3.10 remotes/origin/android-goldfish-3.4 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
Other great article articles
Android Learning Notes ($) Android Options Menu and submenu (submenu) Android Learning note (notification) features and usage of Android Learning notes ($) Android using listeners to listen to menu events Android Learning notes (+) Android Create a single-selection menu and a check menu for jquery tutorials ( -ajax operations based on request load Data jquery tutorial (-ajax) append HTML for operationmore about Android Development articles
Android Linux Kernel compilation