简体   繁体   中英

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.

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. Any idea how to download a specific source directory from GIT repo.

Thanks

It seems you're using the Git fetcher (an entry in SRC_URI starting with git:// ). If you want to checkout only a part of the git repo, you should use subpath and not destsuffix , c.f. 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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