使用带有Yocto食谱的ssh获取私有GitLab存储库 [英] Fetch private gitlab repo using ssh with Yocto recipe

查看:21
本文介绍了使用带有Yocto食谱的ssh获取私有GitLab存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用SSH协议在Yocto镜像食谱中获取一个私有的GitLab存储库。在我的图像配方中,我已将SRC_URI传递为:

SRC_URI = " 
        gitsm://git@git.example.com:2224/blah/blah/blah/blah;protocol=ssh;branch=master 
"

但这会导致错误:

ERROR: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export PATH="/root /build-swu-v2/tmp/sysroots-uninative/x86_64-linux/usr/bin:/root/sources/poky/scripts: /root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/awsclient/1.4- r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/root/build-swu-v2/tmp /work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/awsclient/1.4-r0/recipe-sysroot/usr/bin /crossscripts:/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi /awsclient/1.4-r0/recipe-sysroot-native/usr/sbin:/root/build-swu-v2/tmp/work/cortexa7t2hf- neon-vfpv4-poky-linux-gnueabi/awsclient/1.4-r0/recipe-sysroot-native/usr/bin:/root/build- swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/awsclient/1.4-r0/recipe-sysroot- native/sbin:/root/build-swu-v2/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi /awsclient/1.4-r0/recipe-sysroot-native/bin:/root/sources/poky/bitbake/bin:/root/build-swu- v2/tmp/hosttools"; export HOME="/root"; LANG=C git -c core.fsyncobjectfiles=0 clone --bare  --mirror "ssh://git@git.osb-connagtive.com:2224/iot/products/iot-device-suite_client/aws- iot-client" /root/downloads//git2/git@git.example.com:2224/blah/blah/blah/blah --progress failed with exit code 128, no output
ERROR: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.',  'gitsm://git@git.example.com:2224/blah/blah/blah/blah;protocol=ssh;branch=master')
DEBUG: Python function base_do_fetch finished

但我可以使用git clone克隆回购。

SSH密钥已添加到GitLab。我的~/.ssh中没有配置文件。我需要创建一个配置文件吗?配置文件的内容应该是什么?

更新

在关注了其他帖子中的一些讨论后,我添加了";配置";文件。

~/.ssh/config

Host git.example.com
HostName git.example.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_ed25519.pub
# LogLevel DEBUG3

然后ssh-add ~/.ssh/id_ed25519.pub

Could not open a connection to your authentication agent.

ssh -T git@git.example.com

ssh: connect to host git.osb-connagtive.com port 22: Connection refused

谁能告诉我如何解决这个问题?

提前谢谢。

附言:我使用的是Ubuntu 20.04和Yocto的Dunfell版本。

推荐答案

我找到了问题的解决方案,如下所示。

我的测试应用程序名为Simpledaemon。 我删除了源代码/元简化aemon 我运行了以下bitbake命令

bitbake-layers create-layer ../sources/meta-simpledaemon
bitbake-layers add-layer ../sources/meta-simpledaemon
mkdir ../sources/meta-simpledaemon/recipes-example/simpledaemon
recipetool create -V 1.0 git@gitlab.com:MichaelBMiner/simpledaemon.git -o ../sources/meta-simpledaemon/recipes-example/simpledaemon/
现在我遇到的问题是GitLab默认命名您的主要分支main,Recipe默认查找master。因此,我将我的主要分支机构名称设为MASTER,这一切都奏效了!

这篇关于使用带有Yocto食谱的ssh获取私有GitLab存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆