编译安卓系统源码
编译环境: Nexus5 + Ubuntu16.04 64bit
在新安装的ubuntu 18.04 64bit下编译通过
一、下载安卓系统源码
国内可以通过清华镜像站 https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/ 来下载
sudo apt-get install curl python git -y
git config --global user.email xxx #xxx是github邮箱
git config --global user.mame xxx #xxx是github用户名
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
PATH=~/bin:$PATH
chmod a+x ~/bin/repo
#如果使用清华网址下载, 则修改repo文件, 将url改为:https://mirrors.tuna.tsinghua.edu.cn/git/git-repo
mkdir android-4.4.4_r1 #创建工作目录
cd android-4.4.4_r1
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-4.4.4_r1 #清华网址
#repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.4_r1 #谷歌网址
repo sync -j4 #或使用如下的脚本文件来持续下载
#!/bin/bash
echo "======start repo sync======"
repo sync -j4
while [ $? != 0 ]; do
echo "======sync failed, re-sync again======"
sleep 2
repo sync -j4
done
二、获取驱动文件
1). 获取镜像文件编号 https://source.android.com/setup/build-numbers
2). 下载对应的硬件驱动文件