Skip to main content

Use Private Git Repositories in Yocto Builds

Use this to access private repositories in the BSP workspace.

Add the Repository

Add the private repository to the appropriate kas configuration under the repos key. Replace the repository name, URL, branch, and commit hash with the values for your project.

meta-grinn-genio/kas/default.yml
repos:
meta-my-private-layer:
url: git@gitlab.example.com:my-team/yocto/meta-my-private-layer.git
branch: main
commit: 2a8df281370fef6396e21951c1b60346ca2ee2f0

Check Access

From the kas directory created by the example build setup, forward the SSH agent and check out the repositories:

Development host
KAS_MACHINE=grinn-genio-700-sbc \
KAS_CONTAINER_IMAGE_DISTRO=debian-bookworm \
KAS_WORK_DIR=../.. \
kas-container --ssh-dir "$HOME/.ssh" --ssh-agent \
checkout default.yml

kas clones the configured repositories. For example:

2026-08-24 13:46:47 - INFO - kas 5.3 started on Debian GNU/Linux bookworm
2026-08-24 13:46:47 - INFO - Using /repo as root for repository meta-grinn-genio
2026-08-24 13:46:47 - INFO - Cloning repository meta-arm
2026-08-24 13:46:47 - INFO - Cloning repository meta-asix
2026-08-24 13:46:47 - INFO - Cloning repository meta-browser
2026-08-24 13:46:47 - INFO - Cloning repository meta-clang
2026-08-24 13:46:47 - INFO - Cloning repository meta-lts-mixins
2026-08-24 13:46:47 - INFO - Cloning repository meta-mediatek-bluedroid
2026-08-24 13:46:47 - INFO - Cloning repository meta-mediatek-bsp
2026-08-24 13:46:47 - INFO - Cloning repository meta-mediatek-demo
2026-08-24 13:46:47 - INFO - Cloning repository meta-mediatek-tsn
2026-08-24 13:46:47 - INFO - Cloning repository meta-nn
2026-08-24 13:46:47 - INFO - Cloning repository meta-openembedded
2026-08-24 13:46:47 - INFO - Cloning repository meta-rity
2026-08-24 13:46:47 - INFO - Cloning repository meta-security
2026-08-24 13:46:47 - INFO - Cloning repository meta-tensorflow
2026-08-24 13:46:47 - INFO - Cloning repository poky
2026-08-24 13:46:47 - INFO - Cloning repository meta-my-private-layer
tip

If the private layer is not cloned, verify that ssh-add -l lists the key authorized for the repository.