lg v30 lineage os 编译

ShapeShifter499/LG_v30-LineageOS_Manifest: Manifest needed to help build LineageOS for the LG v30

编译环境搭建

配置

ubuntu 2204

image

仅作示例,硬盘给300g差不多够

配置代理

image

我是nat模式,用第三个

image

终端代理设置

将下面加入环境变量

image

依赖安装

1
2
3
$ sudo update-alternatives --config java

$ sudo apt-get install bc bison build-essential ccache curl flex g++-multilib gcc-multilib git 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 zip zlib1g-dev python libncurses5 libtinfo5

配置repo

1
2
3
$ mkdir -p ~/bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo $chmod a+x ~/bin/repo

将以下内容添加到 ~/.profile 以确保上述 “repo” 二进制文件始终可访问。

1
2
3
4
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

配置ccache

sudo vim ~/.bashrc

加入:

export USE_CCACHE=1

使改动生效:

source ~/.bashrc

执行:

ccache -M 50G

来设置缓存大小

× 注:ccache默认在home目录,请确保home目录有足够的空间。如果想自定义ccache的目录,可以在~/.bashrc​文件里加入export CCACHE_DIR=/path/to/.ccache​。缓存大小根据自己硬盘大小设置,设置25G以上可以显著提高源码的构建速度。

拉取lineage源码

1
2
$ mkdir -p ~/android/lineage/.repo/local_manifests
$ wget -S https://raw.githubusercontent.com/ShapeShifter499/LG_v30-LineageOS_Manifest/lineage-17.1/lg_v30-joan.xml -O ~/android/lineage/.repo/local_manifests/lg_v30-joan.xml
1
$ repo sync

这一步需要几十G的空间,请先准备好

编译

进入源码根路径

执行

1
2
3
source build/envsetup.sh
lunch lineage_joan-userdebug
mka bacon

等待编译即可,第一次编译需要数个小时的时间