KAS(1)
KAS(1) โ kas ๐
โจ
okay so bestie, meet kas โ the setup tool for bitbake based projects. the vibe is lowkey โlet me handle the annoying setup so you can go build.โ ๐ซถ
โจ NAME โจ
kas โ a setup tool for bitbake based projects.
๐ธ SYNOPSIS ๐ธ
kas [-h] [--version] [-l {debug,info,warning,error,critical}]
{build,checkout,clean,cleansstate,cleanall,purge,diff,dump,for-all-repos,lock,menu,shell} ...
๐ DESCRIPTION ๐
kas โ setup tool for bitbake based project. itโs giving โI got you, bestie.โ โจ
This tool provides an easy mechanism to setup bitbake based projects.
The OpenEmbedded tooling support starts at step 2 with bitbake. The downloading of sources and then configuration has to be done by hand. Usually, this is explained in a README. Instead kas is using a project configuration file and does the download and configuration phase.
Key features provided by the build tool:
- clone and checkout bitbake layers
- create default bitbake settings (machine, arch, ...)
- launch minimal build environment, reducing risk of host contamination
- initiate bitbake build process
๐ OPTIONS ๐
๐ Positional Arguments
cmdโ Possible choices:build,checkout,clean,cleansstate,cleanall,purge,diff,dump,for-all-repos,lock,menu,shell
๐ Named Arguments
--versionโ show program's version number and exit-l='info', --log-level='info'โ Set log level (default:info)- Possible choices:
debug,info,warning,error,critical
- Possible choices:
๐ ๏ธ SUB-COMMANDS ๐ ๏ธ
pick your fighter, bestie ๐
kas build ๐ฅ
kas build [-h] [--skip STEP] [--force-checkout] [--update] [-k]
[--target TARGET] [-c TASK] [--provenance {true,mode=min,mode=max}]
[config] [extra_bitbake_args ...]
Checks out all necessary repositories and builds using bitbake as specified in the configuration file.
kas checkout โจ
kas checkout [-h] [--skip STEP] [--force-checkout] [--update] [config]
Checks out all necessary repositories and sets up the build directory as specified in the configuration file.
kas clean ๐งผ
kas clean [-h] [--dry-run] [--isar-privileged | --isar-rootless] [config]
Clean build artifacts, keep sstate cache and downloads.
kas cleansstate ๐งฝ
kas cleansstate [-h] [--dry-run] [--isar-privileged | --isar-rootless] [config]
Clean build artifacts and sstate cache.
kas cleanall ๐ฅ
kas cleanall [-h] [--dry-run] [--isar-privileged | --isar-rootless] [config]
Clean build artifacts, sstate-cache and downloads.
kas purge ๐ฎ
kas purge [-h] [--dry-run] [--isar-privileged | --isar-rootless] [--preserve-repo-refs] [config]
Purge all data managed by kas, including managed repos.
kas diff ๐
kas diff [-h] [--skip STEP] [--force-checkout] [--update] [--format {json,text}] [--oneline] [--no-color] [--commit-only] [--content-only] config1 config2
Compare two kas configurations.
kas dump ๐ค
kas dump [-h] [--skip STEP] [--force-checkout] [--update] [--indent INDENT] [--sort] [--format {yaml,json}] [--resolve-refs] [--resolve-local] [--resolve-env | --lock] [config]
Expand and dump the final config to stdout. When resolving branches, this is done before patches are applied.
kas for-all-repos ๐
kas for-all-repos [-h] [--skip STEP] [--force-checkout] [--update] [-E] [-k] [config] command
Runs a specified command in all checked out repositories.
kas lock ๐
kas lock [-h] [--skip STEP] [--force-checkout] [--update] [--indent INDENT] [--sort] [config]
Create and update kas project lockfiles.
kas menu ๐
kas menu [-h] [kconfig]
Provides a configuration menu and triggers the build of the choices.
kas shell ๐
kas shell [-h] [--skip STEP] [--force-checkout] [--update] [-E] [-k] [-c COMMAND] [config]
Run a shell in the build environment.
๐ PROJECT CONFIGURATION ๐
The project configuration file describes the build environment and the layers to be used. It is the main input to kas. For details, see kas-project-config(1).
๐งพ BUILD ATTESTATION ๐งพ
Kas supports to generate build attestation. For details, see kas-build-attestation(1).
๐ CREDENTIAL HANDLING ๐
kas provides various mechanisms to inject credentials into the build. For details, see kas-credentials(1).
๐ฑ ENVIRONMENT VARIABLES ๐ฑ
kas uses a number of environment variables to configure its behavior. The Variables Glossary provides an overview, wherein the tuple (C,K,E) denotes the scope of the variable.
By default, kas does not inherit the full host shell environment into the build environment. Instead, kas constructs a controlled environment to improve reproducibility and reduce host contamination.
How additional environment variables are handled depends on their scope and on the selected sub-command. Where supported, variables can be defined in the kas configuration or preserved explicitly from the host environment, for example with -E/--preserve-env.
When using kas-container, this is more limited, especially for variables that contain file or directory paths, because the container may use a different directory layout.
All directories that are passed to kas by setting the corresponding environment variables (e.g. KAS_WORK_DIR, KAS_BUILD_DIR, ...) must not overlap with each other, except for overlapping with KAS_WORK_DIR (i.e. the build|sstate|downloads|repo-ref dirs can be below the work dir). Environment variables that reference a file or directory must have a valid path that is accessible and readable.
๐ Variable Scope ๐
kas-container (C)
The variable is processed or forwarded by the kas-container script. For some variables, the variable is re-written to the container's directory layout.
Note: Theenvsection of the project configuration can be used to make arbitrary environment variables available to the build environment. When invoking the build viakas-container, make sure to also forward the corresponding environment variables into the container.
kas (K)
The variable is processed by kas itself. Some variables (e.g. the credentials for the awscli) are re-written to configuration files to also support older versions of the tooling.
build environment (E)
The variable is exported into the build environment. In this environment, the bitbake command is executed.
config-file (c)
The variable can be set in the env section of the Project Configuration <#project-configuration-label>. Note, that a value provided by the calling environment takes precedence over the value in the configuration file.
๐ซ Variables Glossary ๐ซ
Okay bestie, so these env vars get processed before the config file is even read (unless it says otherwise somewhere in here). Which means โ plot twist โ you literally cannot define them or overwrite them using the env section of the config file. They're locked in. Periodt. ๐
KAS_WORK_DIR(C, K) โ the path of the kas work directory. Defaults to your current working directory. Heads up: if you set this, the directory has to already exist. kas is not your mom, it will not create it for you. ๐KAS_BUILD_DIR(C, K) โ the path of the build directory. Defaults to${KAS_WORK_DIR}/build. If you set it, the parent directory must exist. Also kas drops aCACHEDIR.TAGin there, so like, your backup tool knows what's up. ๐KAS_REPO_REF_DIR(C, K) โ the path to the repository reference directory. Repos sitting in this directory get used as references when cloning. For kas to actually find them they need to be named a very specific way, and the repo URLs get translated like this:
https://github.com/siemens/meta-iot2000.git resolves to the name github.com.siemens.meta-iot2000.git.
Repos that aren't found just get cloned below this directory instead. And here's the slay part: multiple instances of kas can work on the same directory simultaneously, as long as the underlying filesystem is POSIX compatible. Iconic. โจ This directory must exist if set.
KAS_DISTROKAS_MACHINEKAS_TARGETKAS_TASK(C, K) โ these overwrite the respective setting in the configuration file. Big main character energy, they just take over. ๐KAS_PREMIRRORS(C, K) โ specifies alternatives for repo URLs. Just like bitbakePREMIRRORS, this variable is made of new-line separated entries. Each entry defines a regular expression to match a URL and, space-separated, its replacement. E.g.:
http://.*\.someurl\.io/ http://localmirror.net/
DISTRO_APT_PREMIRRORS(C,c) โ specifies alternatives for apt URLs. Just likeKAS_PREMIRRORS. Same vibe, apt edition. ๐KAS_CLONE_DEPTH(C, K) โ does a shallow git clone/fetch using--depth=Nwhere N is whatever you put in this variable. Lowkey perfect for CI, when the work directory always starts empty and then gets yeeted after every run anyway. ๐SSH_PRIVATE_KEY(K) โ variable containing the private key that should be added to an internal ssh-agent. Girl, this key cannot be password protected. Useful for CI build servers. On desktop machines tho, an ssh-agent running outside the kas environment is more useful.SSH_PRIVATE_KEY_FILE(K) โ path to the private key file that should be added to an internal ssh-agent. Same deal: this key cannot be password protected. Useful for CI build servers. On desktop machines, an ssh-agent running outside the kas environment is more useful.SSH_AUTH_SOCK(C,K,E) โ SSH authentication socket. Used for cloning over SSH, and it's the alternative toSSH_PRIVATE_KEYorSSH_PRIVATE_KEY_FILE. Take your pick bestie ๐ซถDL_DIRSSTATE_DIRSSTATE_MIRRORS(C,K,E,c) โ environment variables that get transferred to the bitbake environment. And theDL_DIRandSSTATE_DIRdirectories are created along with their parents, if set. So these ones kas will actually make for you. Make it make sense ๐ญTMPDIR(K,E,c) โ directory for temporary files.http_proxyhttps_proxyftp_proxyno_proxy(C,K,E) โ these define the proxy configuration bitbake should use.GIT_PROXY_COMMAND(E)NO_PROXY(C,K,E) โ set proxy for native git fetches.NO_PROXYis evaluated by OpenEmbedded'soe-git-proxyscript. Ngl, very specific but very important. ๐ฅSHELL(C,K,E) โ the shell to start when using theshellplugin and in the bitbake environment.TERM(C,K,E) โ the terminal options used in theshellplugin and in the bitbake environment.TZ(C) โ timezone settings. โ
Also a lil reminder because I know someone's gonna forget: that whole(C),(K),(E),(c)notation is doing heavy lifting here, and the letters that apply to each variable are exactly the ones listed above. Don't skip 'em. ๐
AWS_CONFIG_FILE,AWS_ROLE_ARN,AWS_SHARED_CREDENTIALS_FILE,AWS_WEB_IDENTITY_TOKEN_FILE(K,C)โ these are all just paths to the awscli configuration and credentials files, and they get copied straight into the kas home dir. ๐ Comfy.GIT_CREDENTIAL_HELPER,GIT_CREDENTIAL_USEHTTPPATH(K,C)โ these let you set and configure the git credential helper inside the.gitconfigof the kas user. Your git auth setup, but make it kas-shaped. ๐KAS_GIT_CREDENTIAL_STORE(C)โ path to a git credential store file on the host. The moment you set it, the file gets bind-mounted into the container read-only and the git credential store helper is configured to use it. It's the exact same thing as--git-credential-store. ๐ซถKAS_GIT_CREDENTIAL_SOCKET(C)โ path to the git credential cache daemon socket on the host. Set it and the socket gets bind-mounted into the container, and the git credential cache helper is configured to use it. Same energy as--git-credential-socket. ๐GITCONFIG_FILE(K,C)โ path to a.gitconfigfile which will be copied to the kas home dir as.gitconfig. Slay, same name and everything.NETRC_FILE(K,C)โ path to a.netrcfile which will be copied to the kas home dir as.netrc. ๐NPMRC_FILE(K,C)โ path to a.npmrcfile which will be copied to the kas home dir as.npmrc. Not me giving npm a whole personality. ๐REGISTRY_AUTH_FILE(K,C)โ path to a container registry authentication file.CI_SERVER_HOST,CI_SERVER_PORT,CI_SERVER_PROTOCOL,CI_SERVER_SHELL_SSH_HOST,CI_SERVER_SHELL_SSH_PORT,CI_JOB_TOKEN,CI_JOB_URL,CI_REGISTRY,CI_REGISTRY_USER(K)โ env vars straight outta GitLab CI. If they're set,.netrcis configured to allow fetching from the GitLab instance, and an entry gets appended in caseNETRC_FILEwas given as well.
heads up though โ if the file already contains an entry for that host, most tools would probably take that first one. ๐ญ First come, first served, no cap.
The job URL is added to the provenance attestation (if enabled). And if CI_REGISTRY and CI_REGISTRY_USER are also set, a container registry login file gets created, which is used by docker, podman and skopeo. In case REGISTRY_AUTH_FILE was given as well, the CI login data will be appended to that file. The required base64 encoded login data is generated by kas, bestie โ you don't gotta do it yourself. โจ
GITHUB_ACTIONS,GITLAB_CI(K)โ environment variables from GitHub actions or GitLab CI. If set totrue,.gitconfigis automatically imported. For details, seeGITCONFIG_FILE. Obsessed with a self-configuring setup fr fr. ๐REMOTE_CONTAINERS(K),REMOTE_CONTAINERS_<x>(K,E)โ environment variables related to VSCode Remote Containers. If you're running in this environment,.gitconfigis automatically imported. Devcontainers girlies stay winning. ๐ฆBB_NUMBER_THREADS,PARALLEL_MAKE(C,K,E)โ environment variables to control the concurrency. Go faster, queen. ๐ฅKAS_IMAGE_VERSION(C)โ select the version of the (official) kas container, e.g.4.5. ๐KAS_CONTAINER_IMAGE_DISTRO(C)โ select the base distro and its release of the container image, e.g.debian-bookworm. If not specified, the default (most-recent supported) distro version is used. If it ain't broke, don't pick it. ๐KAS_CONTAINER_IMAGE(C)โ select the container image (full OCI path including tag).KAS_CONTAINER_ENGINE(C)โ explicitly set the container engine, eitherdockerorpodman. If not set, this is auto-detected (preference:docker).KAS_SUDO_CMD(C)โ explicitly set the sudo command, eithersudoorrun0, for operations that require higher privileges. If not set, this is auto-detected (preference:sudo).
note that run0 does not preserve the environment and cannot setup loopback devices. ๐ So like, know that going in.
KAS_BUILDTOOLS_DIR(C,K)โ explicitly set the path where kas will download and install buildtools. If not set, kas will useKAS_BUILD_DIR/buildtoolsas the default path. โจ
๐ SEE ALSO ๐
Go read those too bestie, iykyk. ๐
๐ KAS ๐
Part of the kas(1) suite.
๐ Author ๐
Daniel Wagner, Jan Kiszka, Claudius Heine
๐ Copyright ๐
Siemens and contributors, 2017-2025
okay that's literally the whole entire page, and you ate it up. this was kas 5.4, served fresh on Jun 25, 2026 โ periodt. go build something iconic, bestie ๐
๐ธ
๐ซถ bye!!
๐ฆ where this page comes from
- ubuntu stonking: kas 5.4-1 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms