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 <sys/socket.h>+#include <linux/socket.h>

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

复制代码

-#include <sys/socket.h>+#include <linux/socket.h>

参考: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

相关推荐
洛森唛10 小时前
Elasticsearch DSL 查询语法大全:从入门到精通
后端·elasticsearch
字节跳动数据平台15 小时前
代码量减少 70%、GPU 利用率达 95%:火山引擎多模态数据湖如何释放模思智能的算法生产力
大数据
得物技术16 小时前
深入剖析Spark UI界面:参数与界面详解|得物技术
大数据·后端·spark
武子康18 小时前
大数据-238 离线数仓 - 广告业务 Hive分析实战:ADS 点击率、购买率与 Top100 排名避坑
大数据·后端·apache hive
武子康2 天前
大数据-237 离线数仓 - Hive 广告业务实战:ODS→DWD 事件解析、广告明细与转化分析落地
大数据·后端·apache hive
大大大大晴天2 天前
Flink生产问题排障-Kryo serializer scala extensions are not available
大数据·flink
Elasticsearch3 天前
如何使用 Agent Builder 排查 Kubernetes Pod 重启和 OOMKilled 事件
elasticsearch
Elasticsearch4 天前
通用表达式语言 ( CEL ): CEL 输入如何改进 Elastic Agent 集成中的数据收集
elasticsearch
武子康4 天前
大数据-236 离线数仓 - 会员指标验证、DataX 导出与广告业务 ODS/DWD/ADS 全流程
大数据·后端·apache hive
武子康5 天前
大数据-235 离线数仓 - 实战:Flume+HDFS+Hive 搭建 ODS/DWD/DWS/ADS 会员分析链路
大数据·后端·apache hive