kas and BitBake with the meta-qcom layer to build the kernel
alongside the root file system and all packages.
For standalone builds (kernel only, without Yocto), see
Build the kernel without Yocto.
Access kernel sources
Required meta-layers
The Qualcomm® Linux BSP is built using themeta-qcom Yocto layer.
- meta-qcom (layer): https://github.com/qualcomm-linux/meta-qcom
qli-<version> convention (for example, qli-2.0). For
available tags, see the Qualcomm Linux release notes - Introduction.
Sync meta-layers with kas
Run the following commands from your workspace root directory. After syncing, the workspace will contain ameta-qcom/ directory.
Supported machine configurations
Machine configuration files are located inmeta-qcom/conf/machine/ and follow
the <SoC>-<board>-<variant>.conf naming convention, where:
SoCis the system-on-chip nameboardis the board typevariantis the product type
meta-qcom/conf/machine/include/qcom-base.inc, which every machine configuration
inherits:
linux-qcom is selected for LTS BSP. linux-qcom-next is selected for
mainline BSP, with PREFERRED_VERSION_virtual/kernel left empty.Image recipes and kernel configuration
Image recipes are located inmeta-qcom-distro/recipes-products/images/. The
following table lists the main supported images:
Table: Qualcomm® Linux supported image recipes
| Image name | Description |
|---|---|
qcom-console-image | Boot-to-shell image with basic packages. |
qcom-multimedia-image | Includes multimedia software components: audio, Bluetooth®, camera, computer vision, display, and video. |
See
meta-qcom-distro/recipes-products/images/ for complete list of images that are supported on Qualcomm Linux.| Fragment | Description |
|---|---|
arch/arm64/configs/defconfig | Upstream arm64 defconfig used as the base configuration. |
arch/arm64/configs/prune.config | Prunes configurations from upstream defconfig to optimize build time. |
arch/arm64/configs/qcom.config | Enables Qualcomm-specific configurations not in upstream defconfig. |
kernel/configs/debug.config | Enables standard kernel debug configuration. |
kernel/configs/hardening.config | Enables security configurations for production kernel hardening. |
arch/arm64/configs/rt.config | Enables PREEMPT_RT for real-time kernel builds. |
KBUILD_DEFCONFIG and KBUILD_CONFIG_EXTRA
in your kernel recipe in the meta-qcom layer. The following example shows the
default configuration in recipes-kernel/linux/linux-qcom_6.18.bb:
Yocto maintains an additional distro-level fragment applied on top:
meta-qcom/recipes-kernel/linux/linux-qcom-6.18/configs/bsp-additions.cfg.Build the kernel and modules
- Open a kas shell:
- Build the full image (kernel + root file system):
Enable a debug build
To compile a debug-enabled build, setDEBUG_BUILD=1 as an environment variable
or in build/conf/local.conf:
Common build errors
Configuration changes not reflected in the built image If a kernel config option does not appear in the running kernel after a rebuild:- Add the missing option explicitly to
kernel/configs/debug.config. - Set
DEBUG_BUILD=1before running BitBake to ensure the debug fragment is applied:
do_fetch failure
Verify network connectivity and confirm that SRCREV in the kernel recipe
matches a commit that exists on the specified branch. Check the recipe file
meta-qcom/recipes-kernel/linux/linux-qcom_6.18.bb for the release-pinned revision.
Disk space exhausted during build
A full Yocto build requires at least 300 GB of free space and a swap partition
larger than 32 GB. Clean previous build artifacts to reclaim space:
ERROR_QA or warnings treated as errors
These are typically recipe metadata issues. Inspect the full BitBake log at
build/tmp/work/<SoC>-<board>-<variant>/linux-qcom/*/temp/log.do_compile for
the root cause before changing recipe settings.
