Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yocto submodule update failure

Tags:

ssh

cmake

yocto

I have a server with two git repos on (affinage.git and avondalelibs.git) They contain code built using cmake and make.

I have access on my machine to the server using ssh - the keys are good.

The repo 'affinage' uses 'avondalelibs' as a submodule.

When I clone affinage natively (i.e. not using yocto) the following happens:

chrisbrown@thebeast:/tmp$ git clone ssh://server@thebeast:/home/server/serverrepo/affinage.git
Cloning into 'affinage'...
remote: Enumerating objects: 307, done.
remote: Counting objects: 100% (307/307), done.
remote: Compressing objects: 100% (296/296), done.
remote: Total 307 (delta 158), reused 0 (delta 0)
Receiving objects: 100% (307/307), 2.10 MiB | 7.04 MiB/s, done.
Resolving deltas: 100% (158/158), done.
chrisbrown@thebeast:/tmp$ cd affinage/
chrisbrown@thebeast:/tmp/affinage$ git submodule update --init --recursive
Submodule 'avondalelibs' (ssh://server@thebeast/home/server/serverrepo/avondalelibs.git) registered for path 'avondalelibs'
Cloning into '/tmp/affinage/avondalelibs'...
Submodule path 'avondalelibs': checked out '52d2adc212700056c4b3c9c672702da33073f86a'

Which is good.

When I use Yocto (dunfell) to build the same repo it fails:

Log data follows:
| DEBUG: Executing shell function do_configure
| Submodule 'avondalelibs' (ssh://server@thebeast/home/server/serverrepo/avondalelibs.git) registered for path 'avondalelibs'
| Cloning into '/home/chrisbrown/affinage/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/affinage/1.0-r0/git/avondalelibs'...
| Permission denied, please try again.
| Permission denied, please try again.
| server@thebeast: Permission denied (publickey,password).
| fatal: Could not read from remote repository.

Yocto succeeds in cloning the top repo but fails in initialising the submodules. I am initialising them with a do_configure_prepend() as below:

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

I can't understand why if both repos are from the same server with the same keys there is a 'permission denied'. Anyone know why this might happen?

like image 537
Chris Avatar asked Nov 21 '25 12:11

Chris


1 Answers

Update: I didn't think gitsm was officially supported but it's in the Kirkstone release notes. Just replace the original git in SRC_URI with gitsm. So for the below example it would be:

SRCREV_FORMAT = "default"
SRC_URI = " \
    gitsm://[email protected]/SaschaWillems/Vulkan.git \
    "

Original: We had the same problem. I found a solution in this blog post Bitbake and Git Submodules Done Right, which refers to https://www.openembedded.org/pipermail/bitbake-devel/2019-August/020301.html.

You can populate the submodules in the recipe. This updated example is for https://github.com/SaschaWillems/Vulkan (note it's now out of date for this repo):

SRCREV_FORMAT = "glm_gli"
SRCREV_glm = "01f9ab5b6d21e5062ac0f6e0f205c7fa2ca9d769"
SRCREV_gli = "8e43030b3e12bb58a4663d85adc5c752f89099c0"
SRCREV = "ae0b59c6e2e8630a2ae26f4a0b7a72cbe7547948"

SRC_URI = "git://github.com/SaschaWillems/Vulkan.git \
           git://github.com/g-truc/glm;destsuffix=git/external/glm;name=glm \
           git://github.com/g-truc/gli;destsuffix=git/external/gli;name=gli \
           file://0001-Don-t-build-demos-with-questionably-licensed-data.patch \
"
like image 171
parsley72 Avatar answered Nov 23 '25 05:11

parsley72