在阿里云上使用Docker 编译全志A33 Android 6.0

本地电脑编译慢的情况,又想快速编译,可以在阿里云上使用 抢占试实例便宜实惠

创建ECS实例

配置:
CPU:32核
内存:64GB
硬盘:500G
这个配置首次编译10~20来分钟

image.png

image.png

安装Docker

人家文档很全,去看看吧
https://www.runoob.com/docker/centos-docker-install.html

上传源码

将源码上传到阿里云ECS上,解压到/data/

启动容器

docker run -td   -v /data:/data kylemanna/aosp:6.0-marshmallow 
image.png
#进入容器 
docker exec -it --user root 63e9e959c89b211162ea9774124c92b157f49c5eea073594dcdb50f006ac2afd /bin/bash
# 安装必要软件
apt update
apt install busybox -y
apt install u-boot-tools  -y

export USER=$(whoami)



开始编译

cd /data 里面源码目录
#编译linux内核
cd lichee
./build.sh -p sun8iw5p1_android

#编译 uboot
cd brandy/
./build.sh -p sun8iw5p1

#编译android源文件
cd /data/android
source build/envsetup.sh
lunch astar_d7-eng 
extract-bsp
make –j64   #一般为cpu核心数的一倍
#打包
pack

显示以下结果表示编译成功,镜像输出路径在容器中的/data 目录,在服务器上的路径是刚才源码存储的位置

cardtool.fex Len: 0x41400
cardscript.fex Len: 0x6ea
sunxi_mbr.fex Len: 0x10000
dlinfo.fex Len: 0x4000
arisc.fex Len: 0x35520
boot-resource.fex Len: 0x4dc400
Vboot-resource.fex Len: 0x4
env.fex Len: 0x20000
Venv.fex Len: 0x4
boot.fex Len: 0xe03800
Vboot.fex Len: 0x4
system.fex Len: 0x23d2fee4
Vsystem.fex Len: 0x4
recovery.fex Len: 0xea7800
Vrecovery.fex Len: 0x4
BuildImg 0
Dragon execute image.cfg SUCCESS !
----------image is at----------

/data/lichee/tools/pack/sun8iw5p1_android_d7_uart0.img

pack finish

编译过程中遇到错误

regenerate rootfs cpio
11282 blocks
11990 blocks
awk: line 2: function strtonum never defined
awk: line 2: function strtonum never defined
ERROR: build kernel Failed

解决办法 : apt-get install gawk

你可能感兴趣的:(在阿里云上使用Docker 编译全志A33 Android 6.0)