Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clone a git repo with its submodules recursively in Yocto

Is there any other way to clone all the dependent folders in a Bitbake recipe file (similar to using recursive tag)? I'm currently doing it as below:

SRC_URI="git://[uri_a];...;name=a \
     git://[uri_b];...;destsuffix=git/a/b;name=b \
     git://[uri_c];...;destsuffix=git/a/b/c;name=c"

where "b" & "c" are sub modules of "a".

like image 595
Ram Prasad Avatar asked Jun 01 '16 13:06

Ram Prasad


People also ask

How do I clone a recursive repository?

Cloning a repository that contains submodules. If you want to clone a repository including its submodules you can use the --recursive parameter. If you already have cloned a repository and now want to load it's submodules you have to use submodule update .

What does recursively clone submodules mean?

If you pass --recurse-submodules to the git clone command, it will automatically initialize and update each submodule in the repository, including nested submodules if any of the submodules in the repository have submodules themselves.

Does git clone pull submodules?

It automatically pulls in the submodule data assuming you have already added the submodules to the parent project. Note that --recurse-submodules and --recursive are equivalent aliases.


2 Answers

You have

gitsm:// 

You use it the same way that

git://

For more information, you can read about it here: http://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#gitsm-fetcher

like image 63
David Bensoussan Avatar answered Sep 19 '22 11:09

David Bensoussan


After trying gitsm without success, I manually prepended the fetching of the submodules to the configure step:

do_configure_prepend() {
  cd ${WORKDIR}/git
  git submodule update --init --recursive
}

Note: the same restrictions as gitsm apply, i.e.:

The Git Submodules fetcher is not a complete fetcher implementation. The fetcher has known issues where it does not use the normal source mirroring infrastructure properly. Further, the submodule sources it fetches are not visible to the licensing and source archiving infrastructures.

like image 39
mr_georg Avatar answered Sep 19 '22 11:09

mr_georg