get source - android-x86 - porting android to x86
DESCRIPTION
This page has (hopefully) the latest information about how to build Android for x86 platforms like Eee PC. The built images runs well on a real hardware as well as virtual machines (qemu or virtual box).Now it is very easy to compile Android for x86 platform from our git repositories. You need not to apply any patch. Just follow the below instructions. The branches in Android-x86 treeTRANSCRIPT
![Page 1: Get Source - Android-x86 - Porting Android to x86](https://reader031.vdocuments.us/reader031/viewer/2022013112/55cf99f0550346d0339fcd99/html5/thumbnails/1.jpg)
12/31/13 Get Source - Android-x86 - Porting Android to x86
www.android-x86.org/getsourcecode 1/8
Android-x86 - Porting Android to x86
Search
News
Download
Donate
Get Source
Installation
Screenshots
Documentation
App HowTo
CustomizeKernel
VirtualBoxHowTo
QemuHowTo
Sdcard HowTo
UvesafbHowTo
HowToConfigure…
HowToMakeCam…
HowToUsePrebu…
NFS How To
Touch only device
howto
NDK HowTo
Debug Howto
Add new target
How to wake up the
machine
How to make
virtualbox ICH AC97audio to work with
android eclair-x86
How to boot the
Android-x86 Live-
CD when you haveproblems with your
graphiccard
Supported List
Releases
ReleaseNote 4.0-r1
ReleaseNote 4.0-
RC2
ReleaseNote 4.0-
RC1
ReleaseNote 3.2RC2
ReleaseNote 2.2-r2
ReleaseNote 2.2
ReleaseNote 1.6-r2
ReleaseNote 1.6
Build 20130725
Build 20130228
Build 20120101
Build 20110828
Build 20110101
Build 20100812
Build 20100115
Build 20091113
Get Source
by Chih-Wei Huang (cwhuang) 2009/07/10-2011/12/25
Introduction
This page has (hopefully) the latest information about how to build Android for x86 platforms like Eee PC. The built images runs well on a realhardware as well as virtual machines (qemu or virtual box).
Now it is very easy to compile Android for x86 platform from our git repositories. You need not to apply any patch. Just follow the belowinstructions.
The branches in Android-x86 tree
Since AOSP evolves very quickly, we have created different branches corresponding to different releases of AOSP:
kitkat-x86Based on Android 4.4 release (KitKat).jb-x86Based on Android 4.3 release (Jelly Bean).ics-x86Based on Android 4.0 release (Ice Cream Sandwich).honeycomb-x86Based on Android 3.2 release (Honeycomb).gingerbread-x86Based on Android 2.3 release (Gingerbread).froyo-x86Based on Android 2.2 release (Froyo).eclair-x86Based on Android 2.1 release (Eclair).donut-x86Based on Android 1.6 release (Donut).android-x86-v0.9 (obsolete)Based on Android 1.5 release (Cupcake).
Getting Android-x86 source code
First, follow this page to configure your build environment. Then
$ mkdir android-x86$ cd android-x86$ repo init -u http://git.android-x86.org/manifest -b $branch$ repo sync
Contents
1 Introduction
2 The branches in
Android-x86 tree
3 Getting Android-x86
source code
4 Building the image
4.1 Choose a target
4.2 Building directly
4.3 Using
buildspec.mk
4.4 Using lunch
command
4.5 Build smaller
image
5 Testing
6 Advanced
6.1 Install to USB disk
6.2 Install to hard disk
6.3 Save data to
USB/hard disk
6.4 How to solve
conflicts
6.5 Customize kernel
![Page 2: Get Source - Android-x86 - Porting Android to x86](https://reader031.vdocuments.us/reader031/viewer/2022013112/55cf99f0550346d0339fcd99/html5/thumbnails/2.jpg)
12/31/13 Get Source - Android-x86 - Porting Android to x86
www.android-x86.org/getsourcecode 2/8
Build 20091024
Build 20090916
Build 20090820
ReleaseNote v0.9
Contact Us
Resources
Sitemap
Recent site activity
Links
Nightly build server
Google code project
SourceForge project
Browse the source
Discussion group
Issues tracker
Blog cwhuang
Blog BuilDroid
Blog sceners
Blog beyounn
Blog android-x86
Twitter android_x86
RSS for main page
Developers
Google apps
Google sites
Google mails
Google docs
Google calendar
Google analytics
Where $branch is any branch name described in the previous section. This will point the projects created or modified by android-x86 to our gitserver. All the other projects still point to AOSP.
We also have a git mirror server on SourceForge.net. To use it, you only need to change the repo init command to
$ repo init -u git://android-x86.git.sf.net/gitroot/android-x86/x86/platform/manifest.git -b $branch
Note: the SourceForge manifest points all projects to the SourceForge.net mirror. (no matter modified by android-x86 or not).
You can also find some more info about sync from SourceForge in http://www.android-dev.ro/2011/09/27/building-android-x86-from-sourceforge-and-repo-tool-is-now-on-code-google-com/
If you hope to keep syncing your tree with Android-x86 repository, just do repo sync. No need to do repo init again. However, sometimes youmay see conflicts during repo sync. See the below section for how to solve this situation.
Note: The Android-x86 repository is very big (about > 10GB). If you encounter problems of sync it, it's likely a network problem or our server is toobusy. Repeatedly run 'repo sync' until it succeeds without any error. Do not bother us with any of the syncing problem. For users from US orEurope, we suggest to use the SourceForge mirror.
Building the image
Once the repo sync is complete, you can build either a usb image or a cdrom iso image. Note the original AOSP only support java 1.5 beforeFroyo, but we have patched the build system to support java 1.6. So you can use either java 1.5 or 1.6 to compile the code.
Note: Before froyo-x86 (included), you can build on either a 32-bit or 64-bit host. Since gingerbread-x86, a 64-bit build environment isrecommended.
Choose a target
You need to choose a target for the x86 device you want to use/test. We provides several targets for different branches:
donut-x86eeepc: for ASUS EeePC familyq1u: for Samsung Q1Us5: for Viliv S5
eclair-x86generic_x86: for generic x86 PC/notebookeeepc: for ASUS EeePC family onlyq1u: for Samsung Q1Us5: for Viliv S5
froyo-x86 / gingerbread-x86generic_x86: for generic x86 PC/notebookeeepc: for ASUS EeePC family onlyasus_laptop: for some ASUS laptopstegav2: for Tegatech Tegav2 (may work with other Atom N45x based tablets)sparta: for Dell Inspiron Mini Duo platformvm: for virtual machine (virtual box, qemu, vmware)motion_m1400: for Motion M1400 (Intel Centrino M based with Intel PRO/Wireless)
honeycomb-x86 / ics-x86generic_x86: for generic x86 PC/notebook
![Page 3: Get Source - Android-x86 - Porting Android to x86](https://reader031.vdocuments.us/reader031/viewer/2022013112/55cf99f0550346d0339fcd99/html5/thumbnails/3.jpg)
12/31/13 Get Source - Android-x86 - Porting Android to x86
www.android-x86.org/getsourcecode 3/8
amd_brazos: for AMD Brazos platformeeepc: for ASUS EeePC family onlyasus_laptop: for some ASUS laptopstegav2: for Tegatech Tegav2 (may work with other Atom N45x based tablets)
jb-x86 / kitkat-x86android_x86: for x86 platform
Actually, for historical reason, you have to use eeepc for a generic x86 PC, notebook or netbook before (includes) donut-x86 branch. Since eclair-x86 branch, eeepc is changed to serve ASUS EeePC family only. Do not use it if you are not using an EeePC.
In short, if you don't know how to choose, use eeepc for donut-x86 branch, and use generic_x86 for eclair-x86 to ics-x86 branches. But notegeneric_x86 is just a base for other targets. It doesn't have some advanced features like hardware acceleration.
Since jb-x86 we tried to use android_x86 as a universal target for all x86 devices. However, it may not optimized for a particular target device. Ifyou are a developer, you can create a target based on android_x86 for your device.
If you want to add new target for your x86 device, refer to the article.
Building directly
To build a live cdrom iso image for target android_x86, type:
$ make iso_img TARGET_PRODUCT=android_x86
To generate a live cdrom iso for tegav2, type
$ make iso_img TARGET_PRODUCT=tegav2
Then you will get an iso file out/target/product/x86/android_x86.iso, etc.
If the computer you build on has more then one processor or core, you can take advantage of multiprocessing (or make jobs) by adding -jX to thebeginning of your make command:
$ make -jX iso_img TARGET_PRODUCT=android_x86
Replace X by the number of processors you have. For example, if you have a quad core CPU, replace X with 4:
$ make -j4 iso_img TARGET_PRODUCT=android_x86
Using buildspec.mk
You can create a buildspec.mk in your android-x86 directory to remember a particular target product you build often:
TARGET_PRODUCT:=android_x86TARGET_BUILD_VARIANT:=userdebugTARGET_BUILD_TYPE:=releaseTARGET_KERNEL_CONFIG:=android-x86_defconfig
With your buildspec.mk file in your android-x86 directory, you can just make by
$ make -jX iso_img
![Page 4: Get Source - Android-x86 - Porting Android to x86](https://reader031.vdocuments.us/reader031/viewer/2022013112/55cf99f0550346d0339fcd99/html5/thumbnails/4.jpg)
12/31/13 Get Source - Android-x86 - Porting Android to x86
www.android-x86.org/getsourcecode 4/8
Using lunch command
You can source the file build/envsetup.sh into your bash environment to get some shell functions to help the building:
$ . build/envsetup.sh
Now you can select a target by lunch command:
$ lunch $TARGET_PRODUCT-$TARGET_BUILD_VARIANT
where $TARGET_PRODUCT is any target described in the previous section, and possible values of $TARGET_BUILD_VARIANT are eng,user, userdebug. For example,
$ lunch android_x86-eng
Then you can build by m command:
$ m -jX iso_img
m command is equivalent to make, but you can use it in any subdirectory of the android-x86 tree.
Since froyo-x86, we also add menu selection to lunch command. Just type lunch, and you will get a list of available targets. Choose a target byinputting its number. Alternatively, just type lunch $number.
Build smaller image
If you have squashfs-tools 4.0 (older version will not work) installed in your host, the generated Android core filesystem will be compressed bysquashfs. So the iso file is very small (only about 30-40%). If you hope to disable it, add USE_SQUASHFS=0 to make. You can put it to buildspec.mk:
USE_SQUASHFS := 0
Before froyo-x86 (included), If you hope to get a more smaller image, you may remove the debugging symbols by adding
TARGET_STRIP := 1
Since gingerbread-x86, the debugging symbols are stripped by default. Do not use this option anymore.
Testing
The generated image is located at
out/target/product/$TARGET_PRODUCT/$TARGET_PRODUCT.iso
You can easily test the iso file by a virtual box or qemu. On the booting screen, select the VESA or debug mode to boot.
Of course you can burn the iso to a CD disk and test it on a real hardware. On booting it will automatically detect your hardware and loadnecessary modules. If you have problem with the default frame buffer driver, you may try the VESA mode (select second item on boot screen).
![Page 5: Get Source - Android-x86 - Porting Android to x86](https://reader031.vdocuments.us/reader031/viewer/2022013112/55cf99f0550346d0339fcd99/html5/thumbnails/5.jpg)
12/31/13 Get Source - Android-x86 - Porting Android to x86
www.android-x86.org/getsourcecode 5/8
Since honeycomb-x86, we supports the hybrid iso format. That is, the iso could be dumped to a usb disk directly. You may create a bootable
USB disk by
$ dd if=out/target/product/x86/android_x86.iso of=/dev/sdX
where /dev/sdX is the device name of your USB disk. This feature is only available for iso files released after 2011/12/25. Note usb_img is
deprecated. Do not use it anymore.
Some broken BIOS (e.g., Acer AO) is unable to boot a USB disk created in this way. If so, you may try to create bootable USB drive from the isofile by unetbootin. For both linux and windows user, here are the steps (suggested by Gregory Gee ) :
1. Download the ISO image of android-x86.
2. Download UNetbootin from http://unetbootin.sourceforge.net/ 3. Make sure you USB key is formatted. UNetbootin silently fails to work if not formated. I formatted my USB keyfat32. 4. Run UNetbootin Select your USB key as the Drive. Select the android-x86 ISO file as the disk image. Click ok and wait.
It should take a minute to do. If it only took UNetbootin a few seconds to copy to USB, like my first attempt, thenit didn't work. So remember on future upgrades to reformat your USB key before each android install.
So now you should be able to boot from the USB key. Well, at least it worked for me. The UNetbootin is aninteresting tool too.
Another choice is the Linux Live USB Creator ( LiLi ) project, which officially support Android-x86.
Advanced
This section describes some useful information for advanced users. You may need good linux expertise to complete it.
Install to USB disk
For advanced linux users, you may create a bootable USB disk by hand. Here are the steps:
1. Install grub to your USB diskfind a linux machine with the latest grub installedpartition your USB drive with fdisk or gpartd and mark the partition as bootableformat that partition to ext3 (recommended) or vfat.mount your usb drive to /mntcd /mntgrub-install --root-directory=. --no-floppy /dev/<your usb device node name>cd /boot/grubcreate your menu.lst based on the next section
2. Add this section to menu.lst
title Run Android kernel /android/kernel root=/dev/ram0 androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode SRC=/android initrd /android/initrd.img
title Run Android (VESA mode) kernel /android/kernel root=/dev/ram0 androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode vga=788 SRC=/android initrd /android/initrd.img
title Run Android (Debug mode)
![Page 6: Get Source - Android-x86 - Porting Android to x86](https://reader031.vdocuments.us/reader031/viewer/2022013112/55cf99f0550346d0339fcd99/html5/thumbnails/6.jpg)
12/31/13 Get Source - Android-x86 - Porting Android to x86
www.android-x86.org/getsourcecode 6/8
kernel /android/kernel root=/dev/ram0 androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode vga=788 SRC=/android DEBUG=1 initrd /android/initrd.img
3. Create /android directory in the USB disk, and copy the four files kernel initrd.img ramdisk.img system.sfs (or system.img if you setUSE_SQUASHFS=0) to it.
Then you can boot from the USB disk and enjoy Android. Note all data are saved to the ramdisk, so all will lose after power off. If you hope to savedata to disk, see the next section.
Install to hard disk
Install to a hard disk is just the same as install to a USB disk. Even you do not need to create a new partition. Just copy android files into anexisting partition, install grub to the hard disk (if not done yet), and modify the menu.lst.
People still ask, what if my hard disk is empty? How to install grub and copy files into it? There are several ways to do it. I provide two here:
Boot from any rescue cd like systemrescuecd, and follow the instructions in the previous section.Install your favorite linux distribution, then copy android files and modify the grub menu.
Save data to USB/hard disk
We support two ways to save data to your disk.
Create a subdirectory named data in your /android directory. The user data will be directly saved to that directory. This method only worksfor ext3 partition.
Create a separate partition and save data to it. You have to add DATA=<device_name> to the boot option. For example, suppose your datapartition is /dev/sda2, then add DATA=sda2 to the boot option.
How to solve conflicts
There are several reason to have conflicts during repo sync, say
You modify your tree locally.The upstream changed. Since we usually keep syncing with original Android repository, sometimes we have to rebase with it. That changesthe history and may cause conflicts.
In this section we assume you have conflicts due to the upstream changed. That is, you don't have local modifications. If you do, you have to solveconflicts yourself. If you follow the procedures in this section, you may lose your local modifications.
Here is an example of a conflict in the manifest:
$ repo syncremote: Counting objects: 71, done.remote: Compressing objects: 100% (41/41), done.remote: Total 65 (delta 25), reused 28 (delta 9)Unpacking objects: 100% (65/65), done.From git://git.tarot.com.tw/android-x86/platform/manifest d53e6c1..2de7a11 android-1.5r2 -> origin/android-1.5r2 * [new branch] android-1.5r3 -> origin/android-1.5r3 * [new branch] android-sdk-1.5_r3 -> origin/android-sdk-1.5_r3 d53e6c1..c544020 cupcake -> origin/cupcake * [new branch] cupcake-release -> origin/cupcake-release f4d79b1..6f7e0dd donut -> origin/donut + 7308d31...4a4f936 lan -> origin/lan (forced update) + b480a6d...d82496e local -> origin/local (forced update)
![Page 7: Get Source - Android-x86 - Porting Android to x86](https://reader031.vdocuments.us/reader031/viewer/2022013112/55cf99f0550346d0339fcd99/html5/thumbnails/7.jpg)
12/31/13 Get Source - Android-x86 - Porting Android to x86
www.android-x86.org/getsourcecode 7/8
+ 11c9d96...84345fb master -> origin/master (forced update) + 5bcbf93...66e92cc mirror -> origin/mirror (forced update) + 9f3092f...665f9e8 ssh -> origin/ssh (forced update) + c6037be...d70927f ssh-mirror -> origin/ssh-mirror (forced update) + 00a823f...3ddaf66 test -> origin/test (forced update) * [new tag] android-1.5r3 -> android-1.5r3 * [new tag] android-sdk-1.5_r3 -> android-sdk-1.5_r3Fetching projects: 100% (128/128), done. project .repo/manifests/First, rewinding head to replay your work on top of it...Applying: merge donut, change or add the projects to x86 porterror: patch failed: default.xml:3error: default.xml: patch does not applyUsing index info to reconstruct a base tree...Falling back to patching base and 3-way merge...Auto-merging default.xmlCONFLICT (content): Merge conflict in default.xmlFailed to merge in the changes.Patch failed at 0001 merge donut, change or add the projects to x86 port
When you have resolved this problem run "git rebase --continue".If you would prefer to skip this patch, instead run "git rebase --skip".To restore the original branch and stop rebasing run "git rebase --abort".
repo sync stopped on conflicts. Since we don't have local modifications, just ignore it by git rebase --skip:
$ cd .repo/manifests$ git rebase --skipHEAD is now at 4a4f936 add branch for local lanApplying: add platform/frameworks/policies/base to x86error: patch failed: default.xml:18error: default.xml: patch does not applyUsing index info to reconstruct a base tree...Falling back to patching base and 3-way merge...Auto-merging default.xmlNo changes -- Patch already applied.Applying: add branch for local lanerror: patch failed: default.xml:1error: default.xml: patch does not applyUsing index info to reconstruct a base tree...Falling back to patching base and 3-way merge...Auto-merging default.xmlNo changes -- Patch already applied.
If it complains about another conflict, do git rebase --skip again, until the rebase procedure completes. Usually it is enough, but if you hope tobe absolute clean, you can ignore this branch and checkout a new one:
$ git checkout -t kitkat-x86 m/kitkat-x86
This may not be the best approach to solve conflicts, but should be easy enough for beginners. If you have better suggestions, just tell us.
Customize kernel
If you'd like to customize the kernel for your hardware, read this article for details.
Comments
![Page 8: Get Source - Android-x86 - Porting Android to x86](https://reader031.vdocuments.us/reader031/viewer/2022013112/55cf99f0550346d0339fcd99/html5/thumbnails/8.jpg)
12/31/13 Get Source - Android-x86 - Porting Android to x86
www.android-x86.org/getsourcecode 8/8
Sign in | Report Abuse | Print Page | Remove Access | Powered By Google Sites
You do not have permission to add comments.