This is a particularly geeky post but because Google searches didn't turn up any information I thought it would be helpful to document the issue and solution for others.
I was writing Yocto recipes that pulled from BitBucket git repositories in ssh form and ran into several issues getting a SRC_URI that worked. GitHub uses the same syntax for their ssh repositories.
Yocto recipes can pull from git repositories by setting the SRC_URI variable appropriately. Unfortunately you can't just do:
You'll get errors because the Yocto won't know what kind of url this is. You need to specify the protocol for Yocto to know this is a git repository via "git://", give the appropriate option to the Yocto git.py script to use the ssh protocol, and replace the colon with a slash to prevent the user account from being used as the port number.
The uri format I'm using is:
like:
I was writing Yocto recipes that pulled from BitBucket git repositories in ssh form and ran into several issues getting a SRC_URI that worked. GitHub uses the same syntax for their ssh repositories.
A BitBucket / GitHub git url, in ssh form, looks like:
<username>@bitbucket.org:<account name>/<repository name>.git
a more concrete example for a git repository in one of my BitBucket accounts looks like:
git@bitbucket.org:cmorgan/somerepository.git
Yocto recipes can pull from git repositories by setting the SRC_URI variable appropriately. Unfortunately you can't just do:
SRC_URI = "git@bitbucket.org:cmorgan/somerepository.git
You'll get errors because the Yocto won't know what kind of url this is. You need to specify the protocol for Yocto to know this is a git repository via "git://", give the appropriate option to the Yocto git.py script to use the ssh protocol, and replace the colon with a slash to prevent the user account from being used as the port number.
The uri format I'm using is:
SRC_URI = "git://<username>@bitbucket.org/<account name>/<repository name>.git;protocol=ssh"
like:
SRC_URI = "git://git@bitbucket.org/cmorgan/somerepository.git;protocol=ssh"
Absolute life saver.
ReplyDeleteThis is still helping solve problems. Thanks!
ReplyDelete