打算自己编译T98的代码,找了无数文章,记录一下自己的配置过程。
1安装ubuntu10.04 64bit ,我用的虚拟机是wm6.5。
主要是自己一直用wm6.5,习惯了。现在不知道最新的是什么版本了。查了一下,好像是从8.0开始,开始支持4核,6.5还只能用双核。不过先看看再说吧。不知到make要用多久。
2获得root权限 sdt passwd root 设定root密码之后,手动用root登陆。至于自动什么的,不搞了。
3repo 源代码
根据谷歌的文档,我才用了 repo sync -j1这个方法。
我单位的网是百兆的,实际下载速度,峰值在6M 全部代码下完,貌似下了7G(在ubutn任务管理器里面看网卡的流量。实际硬盘占用超过10G)
4 同步的过程中,磁盘空间不够了。。。我倒。。。还好全部下载完了,只是在验证的时候不够了。
系统可用为0,结果启动的时候,一大堆错误,连登陆背景界面都没有了。。。汗
另外添加了一个32G的磁盘,拷贝所有代码文件到这个磁盘,继续repo sync...
5验证的时候,出现一个文件android.mk 错误
解决办法:进入目录,删掉,再次repo sync
6 error: Exited sync due to gc errors
查找一下,说git的版本过低。。。默认又没有高的。
如果你的系统是Ubuntu10.04,还可尝试如下方法升级git(Ubuntu10.10 的系统该方法试验不成功):
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
即可。
采用这个方法,git --version一下啊,我靠。。。1.8.0.3了。
7 repo sync
结果报了一大堆错误。。。
repo sync -f 看看 也不知道是干什么用的。应该是fix吧。
还是不行。。。
难道要把prebuild全部删掉?看看大小,1.7G 。。。删掉了今天晚上是别想弄好了。
继续找办法。
进入文件管理器,手动删掉错误的文件。
repo sync
另外报了另外一大堆错误。。我算是明白了,prebuild目录就是有问题。删了吧。大不了明天继续下载。今天就算了。。。1.7G 我200K的网速6小时都下不完。
应该是解压缩的时候,磁盘没有空间了。所以错误了。
今天晚上收工了。。。
等下。。。竟然没有下载,好像重新解压缩。提示完成了。。。
8 配置jdk
没有什么说的。按照谷歌来。
Java 6: for Gingerbread and newer
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
Java 5: for Froyo and older
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse"
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse"
$ sudo apt-get update
$ sudo apt-get install sun-java5-jdk
java5不需要。那个是sdk用的。
提示 没有可供安装的候选者。。。。。。。。晕啊
打开新立得 看看 也没有找到。。。
更换软件源 看看
自动选择服务器。
。。。。。。。
死活都安装不上。
找了一大圈,找到一个方案
http://www.eoeandroid.com/blog-489778-2691.html
方法一
由于版权问题,ubuntu 11.10上再也不能直接找到(Oracle) Sun JDK了。需要添加一个特殊的源。
shell代码
- sudo add-apt-repository ppa:ferramroberto/java
- sudo apt-get update
- sudo apt-get install sun-java6-jdk sun-java6-plugin
-
sudo update-alternatives --config java
- 安装完之后,就可已使用sun的jdk了。
可以是可以,就是下载奇慢。。。。。。。。。。。。。。XXXB/S .........
我的个天阿。。。着要到哪年。。。还得哄媳妇睡觉呢。。。
看到这里很多高手肯定要笑了。。。笨死你了,不会下载好bin直接安装???
。。。。。。
算了。睡觉吧。明天再说吧。
来到单位 50K/s 下载。。。还是单位给力。。。
下载完了,配置。提示无须配置。
OK 开始编译吧。。。现在是早上9点正。
$ . build/envsetup.sh
提示 权限不够。。。我晕
cd ..
chmod 777 A(这里A是我的源代码目录) -R这回总行了吧???
desktop:/media/64g/A# build/envsetup.sh
including device/moto/stingray/vendorsetup.sh
including device/moto/wingray/vendorsetup.sh
including device/samsung/crespo4g/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/samsung/toro/vendorsetup.sh
including device/samsung/tuna/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including sdk/bash_completion/adb.bash
报错。。。。。。。。
Choose a Target
Choose which target to build with lunch
. The exact configuration can be passed asan argument, e.g.
$ lunch full-eng
The example above refers to a complete build for the emulator, with all debugging enabled.
If run with no arguments lunch
will prompt you to choose a target from the menu.
All build targets take the form BUILD-BUILDTYPE, where the BUILD is a codenamereferring to the particular feature combination. Here's a partial list:
Build name | Device | Notes |
---|---|---|
full | emulator | fully configured with all languages, apps, input methods |
full_maguro | maguro | full build running on Galaxy Nexus GSM/HSPA+ ("maguro") |
full_panda | panda | full build running on PandaBoard ("panda") |
and the BUILDTYPE is one of the following:
Buildtype | Use |
---|---|
user | limited access; suited for production |
userdebug | like "user" but with root access and debuggability; preferred for debugging |
eng | development configuration with additional debugging tools |
/bin/bash: bison:找不到命令
索性把下面的全装一遍,同时重新启动虚拟机,分配3G内存。
http://blog.csdn.net/andyweike/article/details/6647447
中间遇到的问题
/bin/bash: bison:找不到命令 用sudo apt-get install bison解决。
Your version is: /bin/bash: java: command not found 用sudo apt-get install openjdk-6-jdk解决。
external/clearsilver/cgi/cgi.c:885: error: ‘z_stream’ undeclared 用$ sudo apt-get install gperf解决。
编译过程停留在 target dex:Core 可能是内存分配的太小了,
/bin/bash: flex:找不到命令,用sudo apt-get install flex解决。
安装不上libc6-dev-i386
卡在这里了。
系统libc6 是 ubuntu7.8.需要ubuntu7
如果强制降级,将导致系统不可用。
看了看安装utuntu的iso,发现是 amd-64bit。。。重新下载一个新的看看
下载了一个i386 desktop版本的。还有一个1.7G的,不知道是什么。回来看看。
这回安好了之后,发现是libc6 ubuntu7了。OK应该没有问题了。
继续
curl repo 下载不下来。。。repo 被墙了。。。
还好原来有下载好的repo.拷贝过来
repo sync
fetch出错。。。被墙了。。。无疑。。。
我真心。。。你们明白的。考。奶奶的要浪费多少不必要的时间。
为什么单位可以下,因为单位是固定IP。现在是在家里,用ADSL
真心服气了,现在都凌晨一点了,竟然还设置墙。。。还不如CMCC过了1点就把下载限制给开了呢。
反正之前已经下载完了。只不过是 make错误罢了。
直接make -j4
开始漫长的编译过程了。
我用的是i7 工程版cpu ,双核4线程。
由于虚拟机只能开2核,所以在宿主机器上,可以看到2个核心已经占满。
如果开4核 然后make -j4 应该可以加快编译。以后再试把。
等吧。应该是1点15开始编译的。