> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kernel integration in Yocto

This section describes how the Qualcomm Linux kernel is integrated into the Yocto build system. It establishes a clear boundary with the [Qualcomm Linux Kernel Guide](https://dragonwingdocs.qualcomm.com/System/Kernel/kernel-overview) — this page covers the Yocto-side integration; the Kernel Guide covers kernel development and debugging.

## **Kernel recipes overview**

The Linux kernel recipes used by Qualcomm Linux are in `<workspace>/meta-qcom/recipes-kernel/linux`. Qualcomm Linux supports the long-term support (LTS) Qualcomm Linux kernel v6.18.x.

In the `meta-qcom` layer, there are two kernel recipes:

|    **Kernel Recipe**    |                                           **Purpose**                                          |
| :---------------------: | :--------------------------------------------------------------------------------------------: |
|   `linux-qcom_6.18.bb`  |                        Builds the standard Qualcomm Linux kernel image.                        |
| `linux-qcom-rt_6.18.bb` | Builds the real-time Qualcomm Linux kernel image. Applies `rt.config` for real-time operation. |

For the full recipe details including `SRCREV`, `SRC_URI`, and configuration fragments, see [meta-qcom — Kernel recipes](./meta-qcom#kernel-recipes).

## **Kernel configuration flow**

The Qualcomm Linux kernel recipe uses a layered set of kernel configuration files and fragments:

|       **Variant**       |                        **Configuration and fragments files**                        |
| :---------------------: | :---------------------------------------------------------------------------------: |
|   `linux-qcom_6.18.bb`  | `defconfig`, `hardening.config`, `prune.config`, `qcom.config`, `bsp-additions.cfg` |
| `linux-qcom-rt_6.18.bb` |                           Same as above, plus `rt.config`                           |

When `DEBUG_BUILD=1` is set (via `meta-qcom/ci/debug.yml`), the following additional fragments are applied:

```text theme={null}
KBUILD_CONFIG_EXTRA:append = " ${@oe.utils.vartrue('DEBUG_BUILD', '${S}/kernel/configs/debug.config', '', d)}"
KBUILD_CONFIG_EXTRA:append:aarch64 = " ${@oe.utils.vartrue('DEBUG_BUILD', '${S}/arch/arm64/configs/qcom_debug.config', '', d)}"
```

For kernel development using `devtool`, see [Modify the Qualcomm Device Loader source using devtool](./modify-qdl-source-using-devtool) and [Use Yocto to develop kernel](https://dragonwingdocs.qualcomm.com/System/Kernel/build-kernel-yocto).

## **Device tree integration**

Device tree blobs (DTBs) and overlays (DTBOs) are packaged into a FIT image by the `dtb-fit-image.bbclass` class. The `KERNEL_DEVICETREE` variable in each machine configuration file selects which DTBs and DTBOs to include.

For the full device tree integration details, including `FIT_DTB_COMPATIBLE` entries and FIT image generation, see [meta-qcom — Include DTB and DTB overlay](./meta-qcom#include-dtb-and-dtb-overlay).

For device tree development and platform device tree management, see [Device Tree Architecture](https://dragonwingdocs.qualcomm.com/System/Kernel/device-tree-architecture) and [Locate and Modify Device Trees](https://dragonwingdocs.qualcomm.com/System/Kernel/locate-and-modify-device-trees) in the Kernel Guide.

## **Out-of-tree kernel modules**

To build an out-of-tree kernel module using a Yocto recipe, see [Handle out-of-tree kernel modules and device tree using recipes](./handling-out-of-tree-kernel-modules-and-device-tree-using-recipes).

**Note**

Qualcomm Linux supports out-of-kernel device tree overlays only for the `custom` variant.

## **Next steps**

* For kernel development, configuration, and debugging, see the [Qualcomm Linux Kernel Guide](https://dragonwingdocs.qualcomm.com/System/Kernel/kernel-overview).
* To create a debug build, see [Create a build for debugging](./create-a-build-for-debugging).
