Kas is a python-based tool for automating yocto-based builds.
It relies on a YAML configuration file that describes what meta-layers need
to be downloaded (the repos
section), what’s the default image for the build
and what should be included in the conf/local.conf
file (the
local_conf_header
section). The conf/bblayers.conf
file is automatically
populated, based on the repos
section.
pip3 install kas
pip3 install --upgrade kas
description.yml
.kas build description.yml
kas build --update description.yml
kas build description.yml --target virtual/kernel
do_build
, as defined by BB_DEFAULT_TASK.
kas build description.yml --task do_clean
--continue
, to continue building
even after encountering errors) directly to bitbake. This kind of arguments
must be at the end of the command, end prefixed by a double dash. The official
documentation names them extra_bitbake_args
.
kas build description.yml -- --continue
kas checkout description.yml
source ./poky/oe-init-build-env ./build
.
kas shell description.yml
description.yml
file.header:
version: 11
machine: raspberrypi4-64
distro: poky
target: core-image-minimal
repos:
poky:
url: https://git.yoctoproject.org/git/poky
refspec: dunfell
layers:
meta:
meta-poky:
meta-openembedded:
url: http://git.openembedded.org/meta-openembedded
refspec: dunfell
path: poky/meta-openembedded
layers:
meta-oe:
meta-python:
meta-raspberrypi:
url: https://github.com/agherzan/meta-raspberrypi/
path: poky/meta-raspberrypi
refspec: dunfell
local_conf_header:
standard: |
CONF_VERSION = "1"
PACKAGE_CLASSES = "package_rpm"
SDKMACHINE = "x86_64"
USER_CLASSES = "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
debug-tweaks: |
EXTRA_IMAGE_FEATURES = "debug-tweaks ssh-server-dropbear package-management"
diskmon: |
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
The refspec
parameter can point to either a git branch, tag or commit
hash.
The layers
parameter is optional, and is used only if the repository
contains multiple meta-layers.
The path
parameter is optional, and is used to specify where (relative to
the current directory) the repository will be cloned.
The fragments under the local_conf_header
section can have any name.
All these fragments will be concatenated and placed in the configuration file.