When using GitHub Codespaces with submodules and private repositories,
a separate tool for git authentication is required (see VSCode issue #109050), as the authentication token provided to the GitHub Codespaces virtual machine only allows access to the main repository.
curl -LO https://raw.githubusercontent.com/GitCredentialManager/git-credential-manager/main/src/linux/Packaging.Linux/install-from-source.sh &&
sh ./install-from-source.sh &&
git-credential-manager-core configure
1.1 - Advanced topics
Git Authentication
For private repositories, we need to separately authenticate against the submodule repositories, as
GitHub Codespaces will only inject a token with access rights to the current repository.
After setting up your VSCode DevContainer or GitHub Codespace you can proceed with the actual build process. Here you have two choices - either using the kas-build system or setting up the build manually.
Building with kas
This is the easiest way to build leda semi-automatically
cd /workspaces/meta-leda-fork/
Open the VSCode terminal and run kas build
Note: you can alter the build options by modifying the .config.yaml file in the trunk of the repository
Building manually
You can also build Leda manually if more customization of the build process is required.
export LEDA_WORKDIR=/workspaces/meta-leda-fork/
cd ${LEDA_WORKDIR}
Clone the Poky repository with the required release, e.g. kirkstone and pull updates if necessary:
You can also build one of the target recipies this way:
DISTRO=leda bitbake kanto-container-management
Note: in this case you can set the target architecture and other build options in the build/local.conf file
5 - Restricted Internet
Developers working in a corporate environment may face challenges when building Leda-based images, pulling SDV containers, etc.,
usually due to a restrictive corporate proxy. Thus the objective of this page is to collect helpful guides for mitigating such problems.
HTTP(S) proxy
First you might need to configure your http(s) SOCKS proxy such that the BitBake shell uses it for do_fetch recipe tasks. By default, http_proxy and https_proxy
environment variables are part of the BB_ENV_PASSTHROUGH list and are directly passed from the current environment to BitBake. If you are still facing http(s)_proxy
issues during do_fetch tasks, you might want to check the Working Behind a Network Proxy @ Yocto Project Wiki.
GOPROXY
GOPROXY is a golang-specific mechanism for fetching dependencies during build-time. What is more, gomod-type BitBake recipes pull their external dependencies during
the do_compile task, instead of the do_fetch task leading to further issues. The simplest workaround is to set-up a local (caching) goproxy container on
the build host and make BitBake use that. The following steps assume that the build host has docker installed and working, with access to the docker hub registry.
Hosting a local goproxy server
Start by setting up the goproxy container in host networking mode.
NOTE: Don’t forget to substitute <PROXY_IP> and <PROXY_PORT> with the appropriate address of your HTTP(S) proxy.
This will start a local caching goproxy on port 8081 with a volume named cacheDir for caching the downloaded Go packages. The goproxy container can be configured
further to provide access to private Go-package registries. For more information on its configuration take a look at goproxyio/goproxy on GitHub.
Using the local goproxy server for BitBake builds
Since the main objective of BitBake/kas is to facilitate reproducible builds, only certain variables from the host environment are used for the build. Go, however,
looks at the GOPROXY environmental variable to decide on which proxy to use. That’s why you should first start by exporting the GOPROXY variable in the terminal
from which you will later run the build:
exportGOPROXY="http://127.0.0.1:8081"
To make BitBake use the value of the variable you just exported for the build, you should add it to its “environment passtrough” list:
If you are using kas as a top-level build tool, to set the value of the GOPROXY variable for builds, all you need to do is to add it the env-section of your
kas-config yaml. For example:
Kas will handle the exporting of the variable and adding it to BitBake’s passtrough list automatically from there.
Airgapped container installation
Sometimes devices might not have internet access on first boot and therefore the SDV containers that are needed for provisioning and updating a SDV-image
will not be available.
Build-Time
The meta-leda layer provides an opitional distro feature that pre-downloads and injects a minimal set of SDV container images in Kanto’s local container registry
on first boot.
IMPORTANT: This will lead to a significant increase of the image size since all containers are downloaded as self-contained tarballs and therefore “layer reuse”
is not possible.
To enable this distro feature, add to your local.conf:
If you are using the sdv-image-data image recipe packagegroup-sdv-airgap-containers will be automatically installed when the distro-feature is enabled.
Therefore all you need to add to your local.conf will be:
Note: If you see a message from ctr that the “image might be filtered out” this means that you might have pulled an image for an architecture that
does not match the one of your device.