git - 在 Ubuntu 16.04 中使用 bitbake 构建 yocto 时如何使用私有(private) git repo?

标签 git ubuntu-16.04 yocto bitbake

在配置后使用 bitbake 时,bitbake 在尝试使用 SSH 链接克隆/访问私有(private)存储库之前失败。

$ bitbake linux-imx
git -c core.fsyncobjectfiles=0 ls-remote ssh://git@gitlab.com:~/some-project/some-repo.git
| DEBUG: Python function base_do_fetch finished
| DEBUG: Python function do_fetch finished
| ERROR: Function failed: Fetcher failure: Fetch command failed with exit code 128, output:
| ssh: Could not resolve hostname gitlab.com:~: Name or service not known
| fatal: Could not read from remote repository.
| 
| Please make sure you have the correct access rights
| and the repository exists.
| 
ERROR: Task 4 (/home/user/Projects/some_project/some-project-release-bsp/sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-kernel/linux/linux-imx_4.1.15.bb, do_fetch) failed with exit code '1'

当我尝试从 URL 中删除 ~/ 时,我遇到了类似的错误。

| DEBUG: Python function base_do_fetch finished
| DEBUG: Python function do_fetch finished
| ERROR: Function failed: Fetcher failure: Fetch command failed with exit code 128, output:
| ssh: Could not resolve hostname gitlab.com:some-project: Name or service not known
| fatal: Could not read from remote repository.

我什至尝试将 URL 修改为 https: ,这给了我另一个错误

git -c core.fsyncobjectfiles=0 ls-remote http://gitlab.com/some-project/some-repo.git
| DEBUG: Python function base_do_fetch finished
| DEBUG: Python function do_fetch finished
| ERROR: Function failed: Fetcher failure: Fetch command failed with exit code 128, output:
| fatal: could not read Username for 'https://gitlab.com': No such device or address
| 
ERROR: Task 4 (/home/user/Projects/some-project/some-project-release-bsp/sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-kernel/linux/linux-imx_4.1.15.bb, do_fetch) failed with exit code '1'

当我在终端而不是 bitbake 中尝试相同的操作时,它成功获得了所需的输出

git -c core.fsyncobjectfiles=0 ls-remote git@gitlab.com:some-project/some-repo.git

我使用的是 Ubuntu 16.04。我知道 Yocto 构建未在 Ubuntu 16.04 中测试。

WARNING: Host distribution "Ubuntu-16.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.

但是之前使用公共(public)存储库的构建成功了。那么有没有办法让这个工作?

最佳答案

尝试使用:

git://git@gitlab.com/some-project/some-repo.git;protocol=‌​ssh;branch=${SRCBRAN‌​CH}

在您的 SRC_URI 中。

注意删除 :~

关于git - 在 Ubuntu 16.04 中使用 bitbake 构建 yocto 时如何使用私有(private) git repo?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45592905/

相关文章:

c++ - 将 git 命令挂接到 visual studio 预构建步骤

git - 如何使用 BitBucket 进行发布、构建和/或快照?

linux - Ubuntu 16.04 linux-crashdump 失败

linux-kernel - 如何在 Yocto 中使用自己的设备树和修改后的内核配置?

git - 不能再推送到 github origin master

python - Dulwich ~ 推送到某个分支

javascript - Node ,如何终止/停止 Node 进程? Ubuntu 16.04 长期支持版

php - Laravel Composer 更新失败 Ubuntu

u-boot - 启动时运行 u-boot 命令

linux-kernel - 使用 populate_sdk 包含内核头文件