Chinaunix首页 | 论坛 | 博客
  • 博客访问: 26582
  • 博文数量: 2
  • 博客积分: 231
  • 博客等级: 二等列兵
  • 技术积分: 50
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-24 17:50
文章分类
文章存档

2009年(2)

我的朋友
最近访客

分类:

2009-06-29 22:39:44

Lim,GeunSik刚刚在android-porting讨论组中详细阐述了这个方法。我先把方法放过来,不过还没来得及验证,他用的是ASUS Eee,估计效果和N810上的差不多的。一下所有步骤都是基于Fedora的,ubuntu用户自行参考。

开发环境:
- Linux PC: Fedora 9 ( 2.6.25.6-55.fc9 i686)
. CPU: Intel(R) Core(TM)2 Duo CPU T5750 @ 2.00GHz ( Samsung
SENS R60 Laptop )
. RAM: Samsung DDR Ram
- Target: Eee PC (ASUS) and Samsung nettop NC01
- Reference:

1. Linux发行版信息

首先是验证系统信息

Fedora9$> uname -a
Linux fedora-invain9 2.6.25.6-55.fc9.i686 #1 SMP Tue Jun 10 16:27:49
EDT 2008 i686 i686 i386 GNU/Linux

Fedora9$> gcc –version and Fedora9$> gcc34 –version
Fedora9$> gcc –version
gcc (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)
Copyright (C) 2008 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.

Fedora9$> gcc34 –version
gcc34 (GCC) 3.4.6 20060404 (Red Hat 3.4.6-9)
Copyright (C) 2006 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

2. repo init 和 Sync 操作
- 首先下载Android for x86的完整源代码。Eee pc 的 dev tree 在 “git://android.git.kernel.org/platform/vendor/asus/eee_701.git”.

Fedora9$> cd ~
Fedora9$> mkdir bin_x86 && cd bin_x86
Fedora9$> mkdir mydroid && cd mydroid
Fedora9$> repo init -u git://android.git.kernel.org/platform/manifest.git
-b cupcake
Fedora9$> repo sync
Fedora9$> vi ./.repo/local_manifest.xml





Fedora9$> repo sync
… A new repo command ( 1.8) is available.
… You should upgrade soon:

cp /home/invain/bin_x86/mydroid/.repo/repo/repo /home/invain/bin/
repo

Initializing project platform/vendor/asus/eee_701 …
remote: Counting objects: 33, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 33 (delta 2), reused 33 (delta 2)
Unpacking objects: 100% (33/33), done.
From git://android.git.kernel.org/platform/vendor/asus/eee_701
* [new branch] cupcake -> korg/cupcake
* [new branch] master -> korg/master

3. 构建 x86 android

Fedora9$> export PATH=$PATH:/usr/sbin:/sbin (to use /sbin/tune2fs
command of e2fsprogs pack )
Fedora9$> TARGET_ARCH=x86 TARGET_PRODUCT=eee_701 DISABLE_DEXPREOPT=true CC=gcc34 CXX=g++34 make -j2 installer_img

build/core/product_config.mk:207: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=eee_701
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
build/core/main.mk:178: implicitly installing apns-conf_sdk.xml
…………… Below Omission ……………….

* 在构建中可能遇到一些问题,解决办法是

- 用低版本gcc 替换 gcc-4.3 version. Ubuntu 8.04LT用的是GCC 4.2, Ubuntu 8.10是GCC 4.3,所以推荐用8.04来做build

- 如果你正在使用 GCC 4.3, 请照下面修改源代码中的相关头文件

Fedora9$> vi external/srec/tools/thirdparty/OpenFst/fst/lib/../../fst/
lib/vector-fst.h
Fedora9$> vi external/srec/tools/thirdparty/OpenFst/fst/lib/symbol-
table.cpp
Fedora9$> vi frameworks/base/tools/aidl/aidl.cpp –> #include
, #include
等等。

- Lim,GeunSik使用的是gcc 3.4

#> yum install compat-gcc*
#> rpm -qa | grep compat-gcc
compat-gcc-34-3.4.6-9.i386
compat-gcc-34-c++-3.4.6-9.i386
compat-gcc-34-g77-3.4.6-9.i386

Fedora9$> vi

Fedora9$> ls -lh out/target/product/eee_701/

total 770624
drwxrwxr-x 9 invain invain 4096 2008-12-24 16:05 .
drwxrwxr-x 3 invain invain 4096 2008-12-24 15:34 ..
-rw-rw-r– 1 invain invain 2606080 2008-12-24 15:50 boot.img
-rw-rw-r– 1 invain invain 57 2008-12-24 16:03 clean_steps.mk
drwxrwxr-x 4 invain invain 4096 2008-12-24 15:54 data
drwxrwxr-x 2 invain invain 4096 2008-12-24 15:50 grub
drwxrwxr-x 4 invain invain 4096 2008-12-24 16:05 installer
-rw-rw-r– 1 invain invain 406862848 2008-12-24 16:06 installer.img
-rw-rw-r– 1 invain invain 1951340 2008-12-23 19:18 kernel
drwxrwxr-x 12 invain invain 4096 2008-12-24 16:05 obj
-rw-rw-r– 1 invain invain 607384 2008-12-24 15:50 ramdisk.img
drwxrwxr-x 9 invain invain 4096 2008-12-24 15:50 root
drwxrwxr-x 4 invain invain 4096 2008-12-24 15:50 symbols
drwxrwxr-x 12 invain invain 4096 2008-12-24 15:53 system
-rw-rw-r– 1 invain invain 372056064 2008-12-24 16:05 system.img
-rw-rw-r– 1 invain invain 5156864 2008-12-24 16:04 userdata.img

Fedora9$> file out/target/product/eee_701/installer.img
./out/target/product/eee_701/installer.img: x86 boot sector; GRand
Unified Bootloader, stage1 version 0×3; partition 1: ID=0×83, active,
starthead 0, startsector 2048, 8878 sectors; partition 2: ID=0×83,
starthead 0, startsector 10926, 783728 sectors

Fedora9$> file out/target/product/eee_701/installer.img
File: `./out/target/product/eee_701/installer.img’
Size: 406862848 Blocks: 793552 IO Block: 4096 일반 파일
Device: fd00h/64768d Inode: 5349917 Links: 1
Access: (0664/-rw-rw-r–) Uid: ( 778/ invain) Gid: ( 778/
invain)
Access: 2008-12-24 16:08:21.000000000 +0900
Modify: 2008-12-24 16:06:05.000000000 +0900
Change: 2008-12-24 16:06:05.000000000 +0900

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

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

Fedora9$> pushd out/target/product/eee_701/

Fedora9$> sudo mount -o loop boot.img /mnt

Fedora9#> popd
total 2519
-rw-rw-r– 1 invain invain 77 2008-12-24 15:50 cmdline
-rw-rw-r– 1 invain invain 1951340 2008-12-24 15:50 kernel
-rw-rw-r– 1 invain invain 607384 2008-12-24 15:50 ramdisk

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

Fedora9$> cp /mnt/test/ramdisk /tmp/ramdisk.gz
Fedora9$> pushd /tmp
Fedora9$> gunzip ramdisk.gz
Fedora9$> cpio -iv < ramdisk

Fedora9$> popd
init.goldfish.rc
init
data
init.eee_701.rc
proc
sbin
sbin/adbd
system
init.rc
default.prop
lib
lib/modules
lib/modules/atl2.ko
lib/modules/drm.ko
lib/modules/fbcon.ko
lib/modules/cfbimgblt.ko
lib/modules/i915.ko
lib/modules/cfbcopyarea.ko
lib/modules/bitblit.ko
lib/modules/softcursor.ko
lib/modules/font.ko
lib/modules/cfbfillrect.ko
dev
sys
2958 blocks

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

4. 制作USB安装包

- 在BIOS中把第一启动设备设置成USB,然后

Fedora9$> dd if=out/target/product/eee_701/installer.img of=/dev/your_usb_disk(例如/dev/sda1)

好了,接下来可以用你的android优盘来尝试启动了。Enjoy it。
阅读(986) | 评论(0) | 转发(0) |
0

上一篇:android下载编译以及文件系统提取总结[ZT]

下一篇:没有了

给主人留下些什么吧!~~