天天看点

#DAYU200体验官# OpenHarmony3.1 Release 编译

OpenHarmony3.1 Release 编译

硬件

这边选择的是润和DAYU200开发板(包括触控屏)

选择的理由是因为润和的开发文档相对完善并且鸿蒙官网也有其编译部署流程的整理。

获取源码

我这边参考的是Gitee上OpenHarmony 3.1 Release通过repo+ssh获取

mkdir openharmony
repo init -u [email protected]:openharmony/manifest.git -b refs/tags/OpenHarmony-v3.1-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'      
repo sync -c
repo forall -c 'git lfs pull'      

搭建docker编译环境

# 拉取最新openharmony编译环境docker镜像,镜像较大,拉取时间较长,请耐心等待

docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:1.0.0

# 进入openharmony源码目录下启动镜像
cd openharmony

docker run --name ohos_build -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:1.0.0

# 预编译工具包:下载和编译时间较长,请耐心等待
./build/prebuilts_download.sh
      

编译openharmony标准系统

# 我使用的润和DAYU200开发板是rk3568主板,大家根据自己使用的主板进行name的填写

# 执行编译脚本:如首次编译不成功,且不是下述错误,可考虑再次运行
./build.sh --product-name rk3568 --ccache

# 编译后的img放在在路径 out/rk3568/packages/phone/images 目录里      
  • ​​https://gitee.com/hihope_iot/docs/tree/master/HiHope_DAYU200#https://gitee.com/hihope_iot/docs/blob/master/HiHope_DAYU200/docs/README.md​​
  • ​​https://growing.openharmony.cn/mainPlay/learnPathMaps?id=23​​