获取OpenHarmony源码
0. 前言
本篇文章是通过学习韦东山老师的免费教程整理和总结的,声明一下来源,支持韦东山老师的成果。
1. 安装git工具
sudo apt-get install git
2. 配置git
配置git 客户端的用户信息(用户名、邮箱都可以随便填)
git config --global user.name "sijifan"git config --global user.email "sijifan@qq.com"git config --global credential.helper store
3. 安装 repo
repo工具是用来管理多个GIT仓库的命令,执行如下命令来安装:
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > reposudo cp repo /usr/local/bin/repo && sudo chmod a+x /usr/local/bin/reposudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple requests
注意:第三条命令会执行失败,但是好像对后续获取源码没什么影响。
4. 下载源码
mkdir OpenHarmonycd OpenHarmonyrepo init -u https://gitee.com/openharmony/manifest.git -b OpenHarmony-1.0repo sync -c -j8
等待30分钟左右即可下载完成。
5. 打补丁
下载补丁文件:cd ~/OpenHarmonygit clone https://e.coding.net/weidongshan/openharmony/doc_and_source_for_openharmony.git打补丁:patch -p1 < openharmony_100ask_v1.2.patch
6. OpenHarmony源码树
OpenHarmony├── applications│ └── sample├── base│ ├── global│ ├── hiviewdfx│ ├── iot_hardware│ ├── security│ └── startup├── build│ └── lite├── docs│ ├── api│ ├── bundles│ ├── contribute│ ├── docs-en│ ├── driver│ ├── get-code│ ├── guide│ ├── kernel│ ├── quick-start│ ├── readme│ ├── security│ ├── subsystems│ └── term├── domains│ └── iot├── drivers│ ├── hdf│ └── liteos├── foundation│ ├── aafwk│ ├── ace│ ├── appexecfwk│ ├── communication│ ├── distributedschedule│ ├── graphic│ └── multimedia├── kernel│ ├── liteos_a│ └── liteos_m├── prebuilts│ └── lite├── test│ ├── developertest│ ├── xdevice│ └── xts├── third_party│ ├── bounds_checking_function│ ├── cJSON│ ├── cmsis│ ├── curl│ ├── FatFs│ ├── FreeBSD│ ├── freetype│ ├── googletest│ ├── harfbuzz│ ├── iniparser│ ├── jerryscript│ ├── libjpeg│ ├── libpng│ ├── Linux_Kernel│ ├── ltp│ ├── lwip│ ├── mbedtls│ ├── mtd-utils│ ├── musl│ ├── NuttX│ ├── openssl│ ├── rt_thread│ ├── unity│ ├── wpa_supplicant│ └── zlib├── utils│ └── native└── vendor ├── hisi └── huawei