装置git 并设置邮件和用户名

sudo apt-get install gitgit config --global user.email qin159358883@qq.comgit config --global user.name "hengdi"

将~/bin退出到系统启动中,不便接下来应用repo

echo "PATH=~/bin:\$PATH" >> ~/.bashrc# 刷新bash source ~/.bashrc

装置curl

sudo apt-get install curl

装置 repo

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo##### 给repo减少执行权限chmod a+x ~/bin/repo

创立REPO_URL 这个变量

export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'# cat ~/bin/repo 在其中会发现调用这个变量,如果这个变量不存在,则会应用google的git链接  速度很慢cd ~/bin/aosp

批改 python 软连贯

sudo ln -s /usr/bin/python3.8 /usr/bin/python

初始化仓库:

repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-10.0.0_r17此时报错:fatal: 无法访问 'https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest/':server certificate verification failed. CAfile: none CRLfile: nonemanifests: sleeping 4.0 seconds before retryingfatal: 无法访问 'https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest/':server certificate verification failed. CAfile: none CRLfile: nonefatal: cannot obtain manifest https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest

输出:

git config --global http.sslverify falsegit config --global https.sslverify false

而后进去解压好的aosp 文件夹 开始同步

cd ~/bin/aosprepo sync