修正构建系统文档: 使用repo工具克隆代码 (#461)

This commit is contained in:
LoGin 2023-12-03 14:51:21 +08:00 committed by GitHub
parent 01090de77e
commit 83ed0ebc29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,23 +11,32 @@
### 1.1 下载DragonOS的源代码
  假设您的计算机上已经安装了git您可以通过以下命令获得DragonOS的最新的源代码
#### 1.1.1 安装git和repo工具
```shell
git clone https://github.com/DragonOS-Community/DragonOS
cd DragonOS
sudo apt-get install git repo
echo "export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'" >> ~/.$(basename $SHELL)rc
source ~/.$(basename $SHELL)rc
```
:::{warning}
DragonOS的源代码托管在Github上但是由于Github在国内的访问速度较慢。可能出现克隆失败的情况这时只要重试即可。
#### 1.1.2 克隆DragonOS的代码
当然我们建议您在github上绑定您的电脑的**ssh公钥**
然后通过以下命令来克隆代码防止频繁出现git clone、pull、push失败的情况。
使用https克隆
```shell
git clone git@github.com:DragonOS-Community/DragonOS.git
curl -sSL https://git.mirrors.dragonos.org.cn/DragonOS-Community/manifest/raw/master/scripts/init.sh | bash
```
为了方便后续的开发我们建议您使用ssh克隆请先配置好github的SSH Key以避免由于网络问题导致的克隆失败
使用ssh克隆请先配置好github的SSH Key
```shell
# 使用ssh克隆
bash <(curl -sSL https://git.mirrors.dragonos.org.cn/DragonOS-Community/manifest/raw/master/scripts/init.sh) --use-ssh-after-clone
```
:::
## 2.使用一键初始化脚本进行安装(推荐)
@ -35,6 +44,7 @@ git clone git@github.com:DragonOS-Community/DragonOS.git
&emsp;&emsp;我们提供了一键初始化脚本,可以一键安装,只需要在控制台运行以下命令:
```shell
cd DragonOS
cd tools
bash bootstrap.sh # 这里请不要加上sudo, 因为需要安装的开发依赖包是安装在用户环境而非全局环境
```