下载:http://old-releases.ubuntu.com/r ... 4-desktop-amd64.iso
安装:一直next....就行了。
(这里用11.04版本,MTK建议用10.04,但11.04也是可行的。因为要与展讯平台兼容(展讯android 4.0的说一定要11.04),所以最好是11.04)
安装好ubuntu后:
1、更新源, 把163.com的更新源加上:
[root@serveraf ~]#sudo gedit /etc/apt/sources.list
把下面这段拷贝到最后面。保存.
#网易 Ubuntu 11.04 源(速度很快)
deb http://mirrors.163.com/ubuntu/ natty main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ natty main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ natty-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ natty-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ natty-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ natty-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ natty-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ natty-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ natty-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ natty-updates universe main multiverse restricted
2、更新
[root@serveraf ~]# sudo apt-get update
这段时间有点长。在不断下载。。。
3、先安装这个,展讯SP6820 android 4.0要用到
[root@serveraf ~]# sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev valgrind zlib1g-dev mingw-w64 wine tofrodos
MTK平台65xx要用到的:
[root@serveraf ~]# sudo apt-get install gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev wine mingw-w64 tofrodos samba
这2个安装时间很长。要等。
4、安装java:
jdk1.5 download URL:
http://www.oracle.com/technetwor ... javase5-419410.html
把下载好的jdk-6u30-linux-x64.bin拷贝到/opt/下
[root@serveraf opt]# cp jdk-6u30-linux-x64.bin /opt/
[root@serveraf opt]# chmod a+x jdk-6u30-linux-x64.bin
[root@serveraf opt]# ./jdk-6u30-linux-x64.bin
5、拷贝arm-eabi-4.4.3包,
[root@serveraf ~]# cp -r alps/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3 /opt/
6、切换到安装ubuntu的用户名下
加入环境变量
[user1@serveraf ~]# gedit .bashrc
把下面这些内容拷贝到.bashrc文件的最后面,save.
JAVA_HOME=/opt/jdk1.6.0_30
export JAVA_HOME
ANDROID_JAVA_HOME=/opt/jdk1.6.0_30
export ANDROID_JAVA_HOME
PATH=/opt/arm-eabi-4.4.3/bin:/opt/jdk1.6.0_30/bin:$PATH
执行一下这个步骤
[user1@serveraf ~]#~/.bashrc
7、检查编译环境是否OK。
在alps目录下:
./mk check-env 会有提示.
**********checking Env************
Your building environment is OK
The detail information is in "checkenv.log"!
*************************************************
检查alps/checkenv.log文件,显示如下
Build Environment Check Result Report
*************************************************************
[OS]: Ubuntu 11.04 (64-bit) [WARNING]
your ubuntu os version is higher than recommendation
[Physical Memory Size] : 8145912 K-Bytes [OK]
[make]: 3.81 (64-bit) [OK]
[perl]: 5.10.1 (64-bit) [OK]
[python]: 2.7.1 (64-bit) [WARNING]
your python version is higher than recommendation
[arm-eabi-gcc]: 4.4.3 (32-bit) [OK]
[gcc]: 4.5.2 (64-bit) [WARNING]
your gcc version is higher than recommendation
[jdk]: 1.6.0_30 (64-bit) [OK]
[bison]: 2.4.1 (64-bit) [OK]
[flex]: 2.5.35 (64-bit) [OK]
[gperf]: 3.0.3 (64-bit) [OK]
[mingw]: Installed [OK]
[unix2dos/tofrodos]: Installed [OK]
*************************************************************
----完成------------------
另加几个常用的用法:
A、解压MT65xx代码压缩包命令:
tar -zxf ALPS.JB.MP.V1.16_XXX_TB_JB_GPL.tar.gz
cat ALPS.JB.MP.V1.16_XXX_TB_JB_INHOUSE.tar.gz0* | tar zxf -
B、设置共享模式,
1) 安装samba,ubuntu命令行下输入sudo apt-get install samba
2) 配置samba,ubuntu命令行下输入 sudo gedit /etc/samba/smb.conf,在打开文件的最后,输入共享文件信息,如下:
[Samuel] #共享的文件夹名称
comment = Shared Folder with username and password
path = /home/user1 #共享的文件夹目录
public = yes
writable = yes
force create mode = 0777
force directory mode = 0777
force user =user1
force group = nogroup
available = yes
guest ok = no
browseable = yes
3) 增加个用户 sudo smbpasswd -a user1
4) 在windows 端输入linux机器的ip地址,就可以看到以上共享文件夹”Samuel”。
C、由于ubuntu11.10中默认gnome操作桌面不是很全,会导致现在启动的界面只有主界面,没有上下系统栏,因此还需要在ubuntu端做配置,具体操作如下:
1. ubuntu命令行中输入:sudo apt-get install gnome-panel,安装gnomepanel
2. 安装完毕后,进入/usr/bin/目录,启动gnome-session-properties(名字可能不对),将以上程序添加到会话启动中。具体如下图:
[Add]-->在界面上输入 : name: panel , commond: /usr/bin/gnome-panel
3.设置远程操作模式
1) Unbuntu端,安装sshserver。命令行输入:sudo apt-get install openssh-server
2) windows端,下载xmanager,并安装。
3) windows端,启动xstart, 新建一个session,command为/usr/bin/gnome-session --display $DISPLAY ,具体如下:
其中session为会话名称,host为linux端地址,协议采用ssh,Execution Command是调用的显示会话显示命令,我们这里选的是gnome桌面,点击run。
如果是GB2版本的,需要修改build下面的envsetup.sh
改为 export ANDROID_EABI_TOOLCHAIN=/opt/arm-eabi-4.4.3/bin
还有mbldenv.sh文件
改为
#!/bin/bash
# ##########################################################
# ALPS(Android2.3 based) build environment profile setting
# ##########################################################
# Overwrite JAVA_HOME environment variable setting if already exists
JAVA_HOME=/opt/jdk1.6.0_43
export JAVA_HOME
# Overwrite ANDROID_JAVA_HOME environment variable setting if already exists
ANDROID_JAVA_HOME=/opt/jdk1.6.0_43
export ANDROID_JAVA_HOME
# Overwrite PATH environment setting for JDK & arm-eabi if already exists
PATH=/opt/jdk1.6.0_43/bin:/opt/arm-eabi-4.4.3/bin:$PWD/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
export PATH
# Add MediaTek developed Python libraries path into PYTHONPATH
if [ -z "$PYTHONPATH" ]; then
PYTHONPATH=$PWD/mediatek/build/tools
else
PYTHONPATH=$PWD/mediatek/build/tools:$PYTHONPATH
fi
export PYTHONPATH