Akshay Patole
Akshay Patole

Reputation: 474

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

Upvotes: 2

Views: 5256

Answers (1)

qschulz
qschulz

Reputation: 1763

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.

Upvotes: 4

Related Questions