Ubuntu 22.0.4编译Android系统Rom

安装 ptyon2.7:

sudo apt install python2

whereis python2

sudo ln -s /usr/bin/python2 python

安装JDK:

sudo apt-get install openjdk-8-jdk

安装fastboot:

sudo apt-get install android-tools-fastboot

安装Repo:

sudo apt-get update

sudo apt-get install repo

或者:

$ mkdir -p ~/.bin

$ PATH="${HOME}/.bin:${PATH}"

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo

$ chmod a+rx ~/.bin/repo

安装依赖库:

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 libssl-dev~

安装 build-essential:

sudo apt-get install build-essential

配置SSH

  • 设置SSH Public keys:

终端执行ssh-keygen一直回车,执行完毕后将id_rsa_pub的内容复制下来,添加到setting key里面的new ssh key 框内,并点击aad new ssh key。

id_rsa-pub文件位置:~/.ssh/id_rsa_pub

  • 在终端配置本地gitconfig

git config --global user.name "你的邮箱前缀"

git config --global user.email "你的邮箱(带@xxx.com)"

下载代码&编译:


repo init -u xxx -b xxx -m xxx.xml

repo sync -j 20

source build/envsetup.sh

lunch xxxx-userdebug

make -j 20

编译报错:

报错:Found class java.io.PrintWriter, but unable to insert @libcore.util.NonNull:


cd prebuilts/misc/linux-x86/flex

rm flex-2.5.39

tar zxf flex-2.5.39.tar.gz

cd flex-2.5.39

./configure

make

mv flex ../cd ../

rm -rf flex-2.5.39

mv flex flex-2.5.39

参考:https://forum.odroid.com/viewtopic.php?p=358525#p358525

https://www.yii666.com/article/568439.html

https://zhuanlan.zhihu.com/p/157110146

https://wiki.odroid.com/odroid-n2/software/building_android#android

报错:clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory


sudo apt install libncurses5

报错:multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here

修改:kernel-4.14/scripts/dtc/dtc-lexer.lex.c_shipped


YYLTYPE yylloc;修改为:extern YYLTYPE yylloc;

参考:https://blog.csdn.net/Golden_Chen/article/details/123297964

https://github.com/BPI-SINOVOIP/BPI-M4-bsp/issues/4

https://lkml.org/lkml/2020/4/1/1206

https://zhuanlan.zhihu.com/p/432591735

New address family defined, please update secclass_map.

修改:kernel-4.14/scripts/selinux/genheaders/genheaders.c


-#include +#include

修改:kernel-4.14/scripts/scripts/selinux/mdp/mdp.c


-#include +#include

参考:https://fxkxb.com/index.php/archives/15/

刷机:

~/rom/out/target/product/mico_x10a/MT8168_Android_scatter.txt

整体修改点:

建议直接安装Ubuntu16 会比较顺利,如果已经使用了22.0.4 ,不想重装系统,可以参考本文档进行修改

参考:

https://wiki.odroid.com/odroid-n2/software/building_android#android

你可能感兴趣的:(elasticsearch,大数据,搜索引擎)