背景
编译aosp13刷入Pixel6中。
环境:
以下所有操作需要全球通上网,已经安装git环境。
把Ubuntu源切到国内,下载速度快很多。
sudo apt install unzip zip libssl-dev libffi-dev gnupg flex bison gperf build-essential curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev libz-dev ccache libgl1-mesa-dev libxml2-utils xsltproc开始下载repo,如果已经有可以跳过。
# 根目录下mkdir ~/binPATH=~/bin:$PATHcurl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repochmod a+x ~/bin/repo# 如果想修改repo地址,可以打开repo文件,修改REPO_URL对应地址
下载代码。
mkdir android13cd android13repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifestDownloading Repo source from https://gerrit-googlesource.proxy.ustclug.org/git-reporemote: Finding sources: 100% (10/10)remote: Total 10 (delta 1), reused 10 (delta 1)Your identity is: Your Name <[email protected]>If you want to change this, please re-run 'repo init' with --config-namerepo has been initialized in /home/android/android13repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-13.0.0_r7repo: reusing existing repo client checkout in /home/android/aosp.repo/manifests/: discarding 619 commitsrepo has been initialized in /home/android/android13
开始同步代码:
repo sync -qcj4 --force-sync --current-branch --no-clone-bundle --no-tags这里需要下载100g工具和代码,通常都是晚上下载比较快一点。
开始编译
驱动下载
https://developers.google.com/android/drivers?hl=zh-cn#orioletp1a.221005.002
在代码目录下解压得到sh文件。执行./extra_xx文件,最后授权。
解压完成之后,授予vender目录权限:
sudo chmod -R 777 vendor开始编译:
source build/envsetup.shlunch 24# 使用8线程编译make -j8# 接下里就是等编译完成了。
可以刷入手机了。
手机先重启到BootLoader。(未安装adb的自己解决)
adb reboot bootloader# 查看是手机的连接状态,如果已经连接,会显示一串英文fastboot decices# 手机已经连接执行一下命令fastboot flashall -w
刷入完成,手机自动重启: