3 Star 3 Fork 2

PersonalSummary / Document

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
code_download_and_complier.md 4.57 KB
一键复制 编辑 原始数据 按行查看 历史
闻飞 提交于 2024-01-31 15:13 . add xts build

鸿蒙代码下载编译和烧录方法

一、鸿蒙代码下载

1.1 主干代码下载

master主干介绍

mkdir -p ~/OpenHarmony/master
cd ~/OpenHarmony/master
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
repo start master --all
bash ./build/prebuilts_download.sh
rm ../OpenHarmony_canary_prebuilts -rf

1.2 核心分支代码下载

1.2.1 OpenHarmony-v3.0-LTS版本下载

版本介绍链接

mkdir -p ~/OpenHarmony/OpenHarmony-v3.0-LTS
cd ~/OpenHarmony/OpenHarmony-v3.0-LTS
repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony-v3.0-LTS --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
bash ./build/prebuilts_download.sh
rm ../OpenHarmony_canary_prebuilts -rf

1.2.2 OpenHarmony-3.2-Beta2版本下载

版本介绍链接

mkdir -p ~/OpenHarmony/OpenHarmony-3.2-Beta2
cd ~/OpenHarmony/OpenHarmony-3.2-Beta2
repo init -u https://gitee.com/openharmony/manifest -b OpenHarmony-3.2-Beta2 --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
repo start OpenHarmony-3.2-Beta2 --all
bash ./build/prebuilts_download.sh
rm ../OpenHarmony_canary_prebuilts -rf

1.2.3 OpenHarmony-3.2-Beta3版本下载

版本介绍链接

mkdir -p ~/OpenHarmony/OpenHarmony-3.2-Beta3
cd ~/OpenHarmony/OpenHarmony-3.2-Beta3
repo init -u https://gitee.com/openharmony/manifest -b OpenHarmony-3.2-Beta3 --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
repo start OpenHarmony-3.2-Beta3 --all
bash ./build/prebuilts_download.sh
rm ../OpenHarmony_canary_prebuilts -rf

1.3 自定义分支代码下载-----C9XX

1.3.1 基于OpenHarmony-3.2-Beta2的thead代码下载、编译、烧录

1.3.1.1 代码下载
# 拉取代码
repo init -u https://10.20.14.6/gitlab.com/ohos_thead/manifest.git -b OpenHarmony-3.2-Beta2 -m thead_develop.xml --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
repo start OpenHarmony-3.2-Beta2 --all
bash ./build/prebuilts_download.sh
rm ../OpenHarmony_2.0_canary_prebuilts -rf
1.3.1.2 代码编译

开发过程中建议单模块编译

# 全量代码编译
./build.sh --product-name c9xx --ccache

# 单模块编译
# module_name举例:"kernel:kernel",表示编译kernel目录下的kernel模块,所有后面的kernel是module_name
./build.sh --product-name c9xx --ccache --build-target module

# 内核模块编译
# 方法一:单模块编译
./build.sh --product-name c9xx --ccache --build-target kernel
# 方法二:手动编译
cd device/thead/c9xx/kernel
./build_kernel_single.sh

# unittest测试用例编译
clear; bear ./build.sh --product-name c9xx --gn-args full_mini_debug=false --build-target test_convertxml_unittest --ccache
1.3.1.3 镜像烧录

待补充

1.4 星光JH7100基于riscv64架构的代码下载

1.4.1 OpenHarmony-3.0-LTS版本代码

1.4.1.1 代码下载

OpenHarmony for riscv交叉编译工具链实现

repo init -u https://gitee.com/iscas-taiyang/manifest.git -m OH-3.0-riscv64.xml --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
bash ./build/prebuilts_download.sh
rm ../OpenHarmony_canary_prebuilts -rf
1.4.1.2 代码编译
# ohos-riscv64框架代码编译不带内核
./build.sh --product-name ohos-riscv64 --ccache

# 哪吒D1构建
./build.sh --product-name sunxi_d1 --ccache

1.4.2 OpenHarmony-v3.2-Beta2版本代码

repo init -u https://gitee.com/iscas-taiyang/manifest.git -b OpenHarmony-3.2-Beta2 -m ohos-rv64.xml --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
bash ./build/prebuilts_download.sh
rm ../OpenHarmony_canary_prebuilts -rf

Note: docker安装方法

# 获取镜像
docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.4
# 进入docker构建环境方法
docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.4
strings /lib/x86_64-linux-gnu/libm.so.6 | grep GLIBC_
sudo apt-get install linuxbrew-wrapper
brew install genometools
C++
1
https://gitee.com/personal-summary/document.git
git@gitee.com:personal-summary/document.git
personal-summary
document
Document
master

搜索帮助