介绍

repo是一款基于 Git 构建的工具,它能更便捷地管理许多Git存储库项目,帮我们完成版本库上的升级流程;该工具与 Yocto 项目的分层特性完美契合,可帮助用户更轻松地将自定义层添加到 BSP 中

安装

安装 repo 工具

1
2
3
mkdir ~/bin
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo ~/bin/repo
chmod a+x ~/bin/repo

导入PATH环境变量中

1
export PATH=~/bin:$PATH

设置 REPO_URL 环境变量, 使用清华大学镜像站作为 repo 工具的下载源

1
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'

执行以下命令确保主机环境中 git 设置正确

1
2
git config --global user.name "hywing"
git config --global user.email "hywing.sir@qq.com"

获取

配置完成后, 创建并进入 Yocto 工作目录, 使用 repo 拉取源码, 确保网络通畅

1
2
3
mkdir MYD-LMX91-Yocto
cd MYD-LMX91-Yocto
repo init -u https://github.com/MYiR-Dev/myir-imx-manifest -b i.MX91-6.6.36-scarthgap -m myir-6.6.36-1.0.0.xml

然后输入以下命令开始同步源码

1
repo sync

下载不畅的话,可以执行以下命令将 github 替换为镜像站

1
sed -i 's/github.com/bgithub.xyz/g' .repo/manifests/myir-6.6.36-1.0.0.xml

『 下里巴人 』
海纳百川,文以载道
hywing技术自留地
总访问 113701 次 | 本页访问 326