编译android固件(使用Ubuntu15.10 64位虚拟机)
更新15.10源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
运行下面命令修改:
sudo gedit /etc/apt/sources.list
删除里面所有的内容,增加下面的Ubuntu 15.10源:
deb http://mirrors.hust.edu.cn/ubuntu/ wily main restricted universe multiverse
deb http://mirrors.hust.edu.cn/ubuntu/ wily-security main restricted universe multiverse
deb http://mirrors.hust.edu.cn/ubuntu/ wily-updates main restricted universe multiverse
deb http://mirrors.hust.edu.cn/ubuntu/ wily-proposed main restricted universe multiverse
deb http://mirrors.hust.edu.cn/ubuntu/ wily-backports main restricted universe multiverse
deb-src http://mirrors.hust.edu.cn/ubuntu/ wily main restricted universe multiverse
deb-src http://mirrors.hust.edu.cn/ubuntu/ wily-security main restricted universe multiverse
deb-src http://mirrors.hust.edu.cn/ubuntu/ wily-updates main restricted universe multiverse
deb-src http://mirrors.hust.edu.cn/ubuntu/ wily-proposed main restricted universe multiverse
deb-src http://mirrors.hust.edu.cn/ubuntu/ wily-backports main restricted universe multiverse
sudo apt-get update
make: arm-linux-gnueabi-gcc: Command not found
尝试:
sudo apt-get install gcc-arm-linux-gnueabi
arm-linux-gnueabi-gcc: error: unrecognized command line option ‘–min_array_alignment=4’
arm-linux-gnueabi-gcc: error: unrecognized command line option ‘–no_unaligned_access’
sudo apt-get install libgtk2.0-0:i386
arm-linux-gnueabi-gcc: error trying to exec ‘cc1’: execvp: No such file or directory
权限的问题,找到cc1,修改权限:
Chmod 777 cc1
arm-linux-gnueabi-gcc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
原因是64位的系统,而libstdc++.so.6是32位的
尝试1:
sodu apt-get install lib32z1
sudo apt-get install lib32ncurses5
结果:
apt-get: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21’ not found (required by apt-get)
尝试2:
sudo apt-get install lib32ncurses5 lib32stdc++6 lib32z1
lunch15
提示安装JDK
安装JDK(注意一定要是1.6的版本):
(1) 首先下载JDK: http://www.oracle.com/technetwork/java/javase/downloads/jdk6u35-downloads-1836443.html 下载的是:
jdk-6u45-linux-x64.bin (64位的)
(2) 改变权限 chmod u+x jdk-6u35-linux-i586.bin
(3) 解压./jdk-6u45-linux-x64.bin 解压出来目录是 jdk1.6.0_45
(4) 为JDK新建存放目录 sudo mkdir -p /usr/lib/jvm/
(5) 将解压出来的 jdk1.6.0_45 目录拷贝到新目录 sudo cp -r jdk1.6.0_45/ /usr/lib/jvm/jdk1.6.0_45/
(6) 配置环境变量:
$ sudo vim /etc/profile
在文件的末尾加上如下内容,保存并关闭文件
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin:$PATH
(7)使设置生效:到此部JDK的配置就都完成了
$ source /etc/profile
(8) 测试 java –version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
9.使用旧版本的make:make-3.8.1
到如下地址下载make:
http://ftp.gnu.org/pub/gnu/make/make-3.81.tar.gz
tar zxvf make-3.81.tar.gz
解压的/tmp目录cd进入make目录
./configure –prefix=/usr 指定目录要不然安装完后就是在usr/local/bin/make 这样就不是在/usr/bin/make 存在2个make
type make
make check
make install
10.bison -d -o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
/bin/bash: bison: command not found
make: * [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127
尝试:
sudo apt-get install bison
11.bison -d -o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
make: * [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127
尝试:
sudo apt-get install flex
12.make: * [out/target/product/smfy-super3/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSValueKeywords.h] Error 25
make: * Deleting file out/target/product/smfy-super3/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSValueKeywords.h'
make: *** Waiting for unfinished jobs....
sh: 1: gperf: not found
calling gperf failed: 32512 at ./makeprop.pl line 140.
make: *** [out/target/product/smfy-super3/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSPropertyNames.h] Error 25
make: *** Deleting fileout/target/product/smfy-super3/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSPropertyNames.h’
尝试:
sudo apt-get install gperf
13.In file included from cts/suite/audio_quality/lib/src/SimpleScriptExec.cpp:17:0:
/usr/include/stdlib.h:759:34: fatal error: bits/stdlib-bsearch.h: No such file or directory
compilation terminated.
In file included from cts/suite/audio_quality/lib/src/audio/AudioSignalFactory.cpp:18:0:
/usr/include/stdlib.h:759:34: fatal error: bits/stdlib-bsearch.h: No such file or directory
compilation terminated.
make: * [out/host/linux-x86/obj/STATIC_LIBRARIES/libcts_audio_quality_intermediates/src/audio/AudioSignalFactory.o] Error 1
make: * Waiting for unfinished jobs….
make: * [out/host/linux-x86/obj/STATIC_LIBRARIES/libcts_audio_quality_intermediates/src/SimpleScriptExec.o] Error 1
尝试:
sudo apt-get install gcc-multilib
14.make: * [out/target/product/smfy-super3/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/html/DocTypeStrings.cpp] Error 2
make: * Waiting for unfinished jobs….
make: * [out/target/product/smfy-super3/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/platform/ColorData.cpp] Error 2
尝试:
sudo apt-get install libswitch-perl
15.Copy xml: out/target/product/smfy-super3/system/etc/system_fonts.xml
/bin/bash: xmllint: command not found
make: * [out/target/product/smfy-super3/system/etc/system_fonts.xml] Error 127
尝试:
sudo apt-get install libxml2-utils
16.pack
dragon image.cfg sys_partition.fex [OK]
———-image is at———-
/home/kandy/workspace/superoid/lichee/tools/pack/sun7i_android_smfy-super3.img
pack finish
/home/kandy/workspace/superoid/android42