简体   繁体   English

从 Yocto 中的 git 存储库获取特定目录

[英]Getting a particular directory from git repository in Yocto

I am trying to download/fetch a specific directory from remote GIT repository in yocto recipe.我正在尝试从 yocto 配方中的远程 GIT 存储库下载/获取特定目录。

I have tried below but it is not working我在下面尝试过,但它不起作用

SRC_URI = "git://<GIT_REPO>;protocol=ssh;destsuffix=<path/to/source/directory> \
          "

I am new to Yocto.我是 Yocto 的新手。 Any idea how to download a specific source directory from GIT repo.知道如何从 GIT 存储库下载特定的源目录。

Thanks谢谢

It seems you're using the Git fetcher (an entry in SRC_URI starting with git:// ).看来您正在使用 Git 提取器( SRC_URI中以git://开头的条目)。 If you want to checkout only a part of the git repo, you should use subpath and not destsuffix , c.f.如果您只想检查 git 存储库的一部分,您应该使用subpath而不是destsuffix , c.f。 https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-fetching.html#git-fetcher-git https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-fetching.html#git-fetcher-git

I'm not sure however that it makes sense to your usecase.但是,我不确定这对您的用例是否有意义。 IMO, that is a setting of the Git fetcher that makes sense only when the Git repo is a huge collection of many different pieces of software, or metadata, that you don't need, ever. IMO,这是 Git 提取器的设置,仅当 Git 存储库是您不需要的许多不同软件或元数据的巨大集合时才有意义。 Which is pretty rare in upstream projects.这在上游项目中非常罕见。

If you just want to set your "current working directory" for the recipe to be into a specific path in the git repo, you can use S = "${WORKDIR}/git/somewhere-else" (with somewhere-else to be replaced with the path relative to the root of your git repo.如果您只想将配方的“当前工作目录”设置为 git 存储库中的特定路径,您可以使用S = "${WORKDIR}/git/somewhere-else" somewhere-else替换为相对于 git 存储库的根目录的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM