配置环境
Halium 9 是基于lineage os 16修改而来,所以基本上对环境的要求与其一致,推荐使用内存8gb以上的台式机和梯子进行编译。Ubuntu 20.04亲测是可以通过的。
安装依赖的命令如下
sudo apt-get install -y \
openjdk-8-jdk android-tools-adb bc \
bison build-essential curl flex g++-multilib \
gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev \
lib32readline-dev lib32z1-dev liblz4-tool \
libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev \
libxml2 libxml2-utils lzop pngcrush rsync schedtool \
squashfs-tools xsltproc yasm zip zlib1g-dev git python3 python3-dev \
python-is-python3
然后去弄个可以工作的repo,配置环境的工作就基本完成了。
同步代码
在你的工作目录下开始初始化repo
repo init -u https://github.com/Halium/android -b halium-9.0 --depth=1
针对于天朝环境的优化
repo sync老是因为EOF中断
只能通过一个脚本在repo sync失败后重复sync直到成功为止
#!/bin/bash
echo ¨================start repo sync===============¨
repo sync -f -j10
while [ $? == 1 ]; do
echo ¨================sync failed, re-sync again=============¨
sleep 3
repo sync -f -j10
done
然后执行这个脚本代码的同步基本上就没有问题了。
Google的Aosp Git 404了
注意清华源的lineage镜像是缺东西的,不建议使用。