cupcakeでx86版Androidのビルド

Ubuntu 8.04のVMWareイメージで環境構築したけど、VMPlayerに512MBしかあてなかったのは正直すまんかった。念のために-j2で2スレにしてたけど、それでもDexビルドでスラッシングまくった。1スレ512MB推奨。2GBで4スレ。-j8とか平気で書くandroid.comの中の人ってなんなの?

$ uname -a
Linux ubuntu-vm 2.6.24-22-generic #1 SMP Mon Nov 24 18:32:42 UTC 2008 i686 GNU/Linux

$ gcc --version
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ mkdir cupcake && cd cupcake
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake
$ repo sync 
$ cat .repo/local_manifest.xml
   
     
  
$ repo sync
$ TARGET_ARCH=x86 TARGET_PRODUCT=eee_701 DISABLE_DEXPREOPT=true make -j2 installer_img 

んで、ゆっくりしていった結果。ビルド開始は18:50。

$ ls -lh out/target/product/eee_701/
合計 753M
 -rw-r--r--  1 oedev oedev 2.5M 2008-12-20 21:23 boot.img
 -rw-r--r--  1 oedev oedev   57 2008-12-20 22:15 clean_steps.mk
 drwxr-xr-x  4 oedev oedev 4.0K 2008-12-20 21:32 data
 drwxr-xr-x  2 oedev oedev 4.0K 2008-12-20 19:54 grub
 drwxr-xr-x  4 oedev oedev 4.0K 2008-12-20 22:36 installer
 -rw-r--r--  1 oedev oedev 388M 2008-12-20 22:38 installer.img
 -rw-r--r--  1 oedev oedev 1.9M 2008-12-20 18:45 kernel
 drwxr-xr-x 12 oedev oedev 4.0K 2008-12-20 22:33 obj
 -rw-r--r--  1 oedev oedev 592K 2008-12-20 21:10 ramdisk.img
 drwxr-xr-x  9 oedev oedev 4.0K 2008-12-20 21:09 root
 drwxr-xr-x  4 oedev oedev 4.0K 2008-12-20 19:55 symbols
 drwxr-xr-x 12 oedev oedev 4.0K 2008-12-20 21:29 system
 -rw-r--r--  1 oedev oedev 355M 2008-12-20 22:34 system.img
 -rw-r--r--  1 oedev oedev 5.0M 2008-12-20 21:32 userdata.img

$ file out/target/product/eee_701/installer.img 
out/target/product/eee_701/installer.img: x86 boot sector;
GRand Unified Bootloader, stage1 version 0x3; partition 2:
ID=0x83, starthead 0, startsector 10926, 783672 sectors, code offset 0x48

$ file out/target/product/eee_701/system.img 
out/target/product/eee_701/system.img: Linux rev 0.0 ext2 filesystem data

$ file out/target/product/eee_701/userdata.img 
out/target/product/eee_701/userdata.img: Linux rev 0.0 ext2 filesystem data

$ sudo mount -o loop boot.img /mnt
合計 2.5M
 -rw-r--r-- 1 oedev oedev   77 2008-12-20 21:23 cmdline
 -rw-r--r-- 1 oedev oedev 1.9M 2008-12-20 21:23 kernel
 -rw-r--r-- 1 oedev oedev 592K 2008-12-20 21:23 ramdisk

$ cat /mnt/cmndline
console=tty0 console=ttyS1,115200n8 console=tty0 androidboot.hardware=eee_701

$ cp /mnt/ramdisk /tmp/ramdisk.gz
$ cd /tmp
$ gunzip ramdisk.gz
$ cpio -iv < ramdisk
sys
init.goldfish.rc
system
data
init.rc
proc
init
default.prop
sbin
sbin/adbd
init.eee_701.rc
lib
lib/modules
lib/modules/i915.ko
lib/modules/font.ko
lib/modules/drm.ko
lib/modules/cfbcopyarea.ko
lib/modules/cfbimgblt.ko
lib/modules/bitblit.ko
lib/modules/cfbfillrect.ko
lib/modules/softcursor.ko
lib/modules/fbcon.ko
lib/modules/atl2.ko
dev
2955 blocks

$ file /tmp/init
/tmp/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped

とことで。(え”−−−−−っ