# Getting started

This information explains how to download, configure, and develop the Qualcomm Linux kernel for Qualcomm development kit and their associated
components to build and flash system images.

Before you begin downloading and configuring the Qualcomm Linux kernel, set up your host computer as described in the [Qualcomm
Linux Build Guide](bundle/publicresource/topics/80-70015-254), which
also provides information about the common Qualcomm Linux kernel workflows.

## Access Qualcomm Linux kernel source code

To access the source code for the Qualcomm Linux kernel, see the
[Qualcomm Linux Build Guide](bundle/publicresource/topics/80-70015-254)
and get all the necessary Qualcomm Linux meta layers.

Qualcomm Linux uses the LTS Linux kernel (6.6.x). Qualcomm supports two variants
of software:

> 
> 
> - Base board support package (BSP)
> - Custom BSP

Note

- **Base BSP** variant uses the upstream LTS Linux kernel (6.6.x) with a limited set of downstream patches.
- **Custom BSP** variant uses a customized LTS Linux kernel (6.6.x) and is hosted at the Qualcomm repository on CodeLinaro.

Table: Kernel recipe path of the variants

| Variant | Kernel recipe path |
| --- | --- |
| Base BSP | `recipes-kernel/linux/linux-qcom-base_6.6.bb` |
| Custom BSP | `recipes-kernel/linux/linux-qcom-custom_6.6.bb` |

Note

The kernel recipe for base BSP and custom BSP is present in the `meta-qcom-hwe` layer.

See the `recipes-kernel/linux/linux-qcom-base_6.6.bb` or `recipes-kernel/linux/linux-qcom-custom_6.6.bb` file to know the Git
uniform resource identifier (URI) to download the kernel source code.

For more information on Qualcomm Linux layers, see [Qualcomm BSP
metadata
layers](https://docs.qualcomm.com/bundle/publicresource/topics/80-70015-27/platform_software_features.html#sub$qualcomm_bsp_metadata_layers).

> 
> 
> Note
> 
> 
> Yocto recipe refers to Qualcomm Linux kernel sources that are publicly hosted at [CodeLinaro](https://git.codelinaro.org/clo/la/kernel/qcom).

The following examples show the Qualcomm Linux kernel recipe source URI information for the base BSP and custom BSP:

**Base BSP**

The following is the source URI information for the base BSP variant:

> 
> 
> SECTION = "kernel"
>     
>     SUMMARY = "Linux kernel for QCOM devices"
>     DESCRIPTION = "Recipe to build Linux kernel from 6.6 LTS branch"
>     
>     LICENSE = "GPL-2.0-only"
>     LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
>     
>     inherit kernel
>     
>     COMPATIBLE_MACHINE = "(qcom)"
>     
>     SRC_URI = " git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git;protocol=https;branch=linux-6.6.y \
>              file://qcom.cfg \
>        "
>     Copy to clipboard

**Custom BSP**

The following is the source URI information for the custom BSP variant:

> 
> 
> SECTION = "kernel"
>     
>     SUMMARY = "Linux kernel for QCOM devices"
>     DESCRIPTION = "Recipe to build Linux kernel"
>     
>     LICENSE = "GPLv2.0-with-linux-syscall-note"
>     LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
>     
>     inherit kernel
>     
>     COMPATIBLE_MACHINE = "(qcom)"
>     
>     SRC_URI = "git://git.codelinaro.org/clo/la/kernel/qcom.git;protocol=https;rev=350dfd604d2ffbe0cac99bf3459b49114aad11f4;branch=kernel.qclinux.1.0.r1-rel \
>       file://QCLINUX-arm64-dts-qcom-sa8775p-ride-add-board-id-and.patch \
>       ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', ' file://selinux.cfg', '', d)} \
>       ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', ' file://selinux_debug.cfg', '', d)} \
>       "
>     Copy to clipboard

## Identify supported Qualcomm machines

The Qualcomm machine configuration files are present in the
`meta-qcom-hwe/conf/machine/` directory.

Machine configuration files follow a `<SoC>-<board>-<variant>​.conf` naming convention, where:

- `SoC` is the system-on-chip (SoC) name
- `board` is the type of board for which the software is built
- `variant` is the type of product

For example:

In `qcs6490-rb3gen2-core-kit.conf` filename,

- `qcs6490` is the SoC
- `rb3gen2` is the board
- `core-kit` is the type of product

The same naming convention is followed in platform-specific device tree files.

The following example shows the list of supported machines that are configured for Yocto machine:

ls -l ./LE.QCLINUX.1.0/layers/meta-qcom-hwe/conf/machine/*.conf
    
    meta-qcom-hwe/conf/machine/qcs6490-rb3gen2-core-kit.conf
    meta-qcom-hwe/conf/machine/qcs6490-rb3gen2-vision-kit.conf
    meta-qcom-hwe/conf/machine/qcs9075-ride-sx.conf
    Copy to clipboard

The following example shows the machine configuration selection for the development board with Qualcomm chipset:

$ less meta-qcom-hwe/conf/machine/<SoC>-<board>-<variant>.conf
    
    #@TYPE: Machine
    #@NAME: <Machine name same as the machine conf file or ``<SoC>-<board>-<variant>`` >
    #@DESCRIPTION: Machine configuration for the development board, with Qualcomm qcs6490
    
    require conf/machine/include/qcom-<SoC>.inc
    Copy to clipboard

The following example shows the kernel configuration selection for base and custom BSP variants:

less meta-qcom-hwe/conf/machine/include/qcom-base.inc
    
    # Provider for linux kernel
    # qcom-base-bsp uses 'linux-qcom-base' as kernel
    PREFERRED_PROVIDER_virtual/kernel ?= "linux-qcom-custom"
    PREFERRED_PROVIDER_virtual/kernel:qcom-base-bsp ?= "linux-qcom-base"
    Copy to clipboard

Note

- `linux-qcom-base` is selected when the base BSP variant is compiled.
- `linux-qcom-custom` is selected when a custom BSP is compiled.

## Build Yocto image recipes and kernel configuration

You can access the Qualcomm Linux image recipes to modify the kernel
configurations. The following table lists the supported
`meta-qcom-hwe` images:

Table: Qualcomm Linux supported image recipes

| Image name | Description |
| --- | --- |
| qcom-console-image<br>    Copy to clipboard | This is a boot to shell image with the package group to bring in all basic packages. |
| qcom-multimedia-image<br>    Copy to clipboard | This image recipe includes recipes for multimedia software components, such as audio, Bluetooth^®^, camera, computer vision, display, and video. |
| qcom-multimedia-test-image<br>    Copy to clipboard | This image recipe includes tests. |

After downloading the Qualcomm Linux code, run the `bitbake` command to build the image.

Note

The base BSP variant uses a `arch/arm64/configs/defconfig` kernel configuration file. Local changes are overlaid on top of `defconfig`
from `meta-qcom-hwe/recipes-kernel/linux/linux-qcom-base-6.6/qcom.cfg` file.

To compile the Qualcomm Linux kernel for the base BSP variant, run the following commands:

# Use the filename of Machine conf file for MACHINE parameter
    $ MACHINE=<SoC>-<board>-<variant> DISTRO=qcom-wayland QCOM_SELECTED_BSP=base source setup-environment
    
    # build qcom linux console image
    $ bitbake qcom-console-image
    
    # Build Images are produced under "build-qcom-wayland/tmp-glibc/deploy/images/<SoC>-<board>-<variant>/qcom-console-image/"
    Copy to clipboard

To build the images listed in the [Table: Qualcomm Linux supported image recipes](https://docs.qualcomm.com/doc/80-70015-3/topic/getting_started_chapter2.html#qualcomm-linux-supported-image-recipes), the Qualcomm
Linux kernel custom BSP recipe uses one of the following kernel configuration
fragments:

Note

Downstream kernel configuration files contain `addons`.

Table: Custom BSP kernel configuration fragments

| Kernel configuration fragments | Description |
| --- | --- |
| <kernel_src>/arch/arm64/configs/qcom_defconfig<br>    Copy to clipboard | Requires the base configuration of the product to be aligned with the upstream kernel. |
| <kernel_src>/arch/arm64/configs/qcom_debug.config<br>    Copy to clipboard | Debugs a configuration fragment from the upstream kernel. |
| <kernel_src>/arch/arm64/configs/qcom_addons.config<br>    Copy to clipboard | Adds Qualcomm downstream additions on top of the upstream aligned base. |
| <kernel_src>/arch/arm64/configs/qcom_addons_debug.config<br>    Copy to clipboard | Enables Qualcomm downstream debug. |

To build Qualcomm Linux including the kernel for the custom BSP variant, run the following commands:

# Use the filename of Machine conf file for MACHINE parameter
    $ MACHINE=<SoC>-<board>-<variant> DISTRO=qcom-wayland QCOM_SELECTED_BSP=custom source setup-environment
    
    # build qcom linux console image
    $ bitbake qcom-console-image
    
    # Build Images are produced under "build-qcom-wayland/tmp-glibc/deploy/images/<SoC>-<board>-<variant>/qcom-console-image/"
    Copy to clipboard

The kernel default builds are defined in the `linux-qcom-base_6.6.bb` or `linux-qcom-custom_6.6.bb` file.

Qualcomm Linux kernel recipes support number 3 (performance) and number 4 (debug) builds mentioned in the following table. The default build configuration is #3 (performance). The following kernel configuration fragments are only applicable to the custom BSP variant.

> 
> 
> Table: Custom BSP kernel build configuration type and configurations
> 
> 
> | Serial number | Kernel build configuration type | Defconfig/config fragments |
> | --- | --- | --- |
> | 1 | Base | arch/arm64/configs/qcom_defconfig<br>    Copy to clipboard |
> | 2 | Debug enabled base | <ul><br><li><div class="highlight-pre notranslate"><div class="highlight"><pre class="pre codeblock"><code>arch/arm64/configs/qcom_defconfig<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></li><br><li><div class="highlight-pre notranslate"><div class="highlight"><pre class="pre codeblock"><code>arch/arm64/configs/qcom_debug.config<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></li><br></ul> |
> | 3 | Base with downstream additions | <ul><br><li><div class="highlight-pre notranslate"><div class="highlight"><pre class="pre codeblock"><code>arch/arm64/configs/qcom_defconfig<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></li><br><li><div class="highlight-pre notranslate"><div class="highlight"><pre class="pre codeblock"><code>arch/arm64/configs/qcom_addons.config<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></li><br></ul> |
> | 4 | Debug enabled base with downstream | <ul><br><li><div class="highlight-pre notranslate"><div class="highlight"><pre class="pre codeblock"><code>arch/arm64/configs/qcom_defconfig<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></li><br><li><div class="highlight-pre notranslate"><div class="highlight"><pre class="pre codeblock"><code>arch/arm64/configs/qcom_debug.config<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></li><br><li><div class="highlight-pre notranslate"><div class="highlight"><pre class="pre codeblock"><code>arch/arm64/configs/qcom_addons.config<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></li><br><li><div class="highlight-pre notranslate"><div class="highlight"><pre class="pre codeblock"><code>arch/arm64/configs/qcom_addons_debug.config<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></li><br></ul> |

For more information on configuring the kernel, see [Kernel configurations](https://docs.qualcomm.com/doc/80-70015-3/topic/features.html#kernel-configuration-1).

### Compile a Qualcomm debug build

Run the following command to compile a debug build:

$ DEBUG_BUILD=1 bitbake qcom-console-image
    Copy to clipboard

To modify the build configurations, update the `KERNEL_CONFIG` and
`KERNEL_CONFIG_FRAGMENTS` variables in the
`linux-qcom-base_6.6.bb` or `linux-qcom-custom_6.6.bb` kernel recipe in the `meta-qcom-hwe`
layer.

### Example kernel configuration

The following examples show kernel configuration for base and custom BSPs:

**Base BSP**

The following example shows the kernel configuration using the
`linux-qcom-base_6.6.bb` kernel recipe:

> 
> 
> KERNEL_CONFIG_FRAGMENTS:append = " ${WORKDIR}/qcom.cfg"
>     
>     S = "${WORKDIR}/git"
>     
>     # 6.6.38
>     SRCREV = "2928631d5304b8fec48bad4c7254ebf230b6cc51"
>     PV = "6.6+git${SRCPV}"
>     
>     KERNEL_CONFIG ??= "defconfig"
>     Copy to clipboard

**Custom BSP**

The following example shows the kernel configuration using the
`linux-qcom-custom_6.6.bb` kernel recipe:

> 
> 
> KERNEL_CONFIG ??= "qcom_defconfig"
>     
>     KERNEL_CONFIG_FRAGMENTS:append = " ${S}/arch/arm64/configs/qcom_addons.config"
>     KERNEL_CONFIG_FRAGMENTS:append = " ${@oe.utils.vartrue('DEBUG_BUILD', '${S}/arch/arm64/configs/qcom_debug.config', '', d)}"
>     KERNEL_CONFIG_FRAGMENTS:append = " ${@oe.utils.vartrue('DEBUG_BUILD', '${S}/arch/arm64/configs/qcom_addons_debug.config', '', d)}"
>     
>     # Enable selinux support
>     SELINUX_CFG = "${@oe.utils.vartrue('DEBUG_BUILD', 'selinux_debug.cfg', 'selinux.cfg', d)}"
>     KERNEL_CONFIG_FRAGMENTS:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', '${WORKDIR}/${SELINUX_CFG}', '', d)}"
>     Copy to clipboard

For more information on the build instructions, see [Build with QSC
CLI](https://docs.qualcomm.com/bundle/publicresource/topics/80-70015-254/build_from_source_QSC_CLI.html)
in the [Qualcomm Linux Build
Guide](bundle/publicresource/topics/80-70015-254).

## Access the platform device tree

The Qualcomm device tree source inclusion (DTSI) and device tree source
(DTS) files for supported development kits are located under the
kernel source in the `arch/arm64/boot/dts/qcom/` directory. These
Qualcomm files segregate the upstream-aligned and downstream
additions.

The device tree files with `addons` are downstream files.
The base BSP variant software does not use any downstream device tree files.

`<SoC>-<board>-<variant>​.conf` is the Qualcomm Linux machine configuration
file that contains the required device tree blob (DTB) selection configuration data.

- `SoC` is any supported Qualcomm chipset. For example, QCS6490 and QCS9075.
- `board` is an RB3 Gen 2 supported product.
- `variant` is the type of product, for example core-kit.

The following example shows the DTB inclusion into the device configuration file:

KERNEL_DEVICETREE = " \
                          qcom/<SoC>-addons-<variant>.dtb \
                          "
    Copy to clipboard

Tab QCS6490
Tab QCS9075

The following table lists the Qualcomm device tree files for the Qualcomm RB3 Gen 2 Development Kit.

> 
> 
> Table: Qualcomm device tree source
> 
> 
> | Device tree source | Details |
> | --- | --- |
> | arch/arm64/boot/dts/qcom/sc7280.dtsi<br>    Copy to clipboard | The QCS6490 SoC is derived from the SC7280. |
> | arch/arm64/boot/dts/qcom/qcs6490.dtsi<br>    Copy to clipboard | The QCS6490 DTSI that hosts any changes is different from the SC7280 SoC. |
> | arch/arm64/boot/dts/qcom/qcs6490-addons.dtsi<br>    Copy to clipboard | Downstream additions specific to the QCS6490 SoC. |
> | arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts<br>    Copy to clipboard | Device tree source for the QCS6490 Qualcomm RB3 Gen 2 Development Kit. |
> | arch/arm64/boot/dts/qcom/qcs6490-addons-rb3gen2.dts<br>    Copy to clipboard | Downstream additions specific to the QCS6490 for the Qualcomm RB3 Gen 2 Development Kit. |
> | arch/arm64/boot/dts/qcom/qcs5430-addons-rb3gen2.dts<br>    Copy to clipboard | Downstream additions specific to the QCS5430 feature pack-1 for the Qualcomm RB3 Gen 2 Development Kit. |
> | arch/arm64/boot/dts/qcom/qcs5430-fp2-addons-rb3gen2.dts<br>    Copy to clipboard | Downstream additions for the QCS5430 feature pack-2 in the Qualcomm RB3 Gen 2 Development Kit. |
> | arch/arm64/boot/dts/qcom/qcs5430-fp2p5-addons-rb3gen2-vision-mezz.dts<br>    Copy to clipboard | Downstream additions for the QCS5430 feature pack-2.5 in the RB3 Gen 2 vision mezzanine development kit. |
> | arch/arm64/boot/dts/qcom/qcs5430-fp3-addons-rb3gen2-vision-mezz.dts<br>    Copy to clipboard | Downstream additions for the QCS5430 feature pack-3 in the RB3 Gen 2 vision mezzanine development kit. |

The following table lists the Qualcomm device tree files for the QCS9075 development kit. By default the addons DTB is used.

> 
> 
> Table : Qualcomm device tree source
> 
> 
> | Device tree source | Details |
> | --- | --- |
> | arch/arm64/boot/dts/qcom/sa8775p.dtsi<br>    Copy to clipboard | The QCS9075 SoC is derived from the SA8775P. |
> | arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi<br>    Copy to clipboard | Qualcomm development kit for the QCS9075. |

## Manage out-of-tree DT overlay fragments

SoC machine configuration files include additional out-of-tree DTB overlays (DTBO).

Graphics, camera, wireless local area network (WLAN) drivers, and their
device tree configurations are maintained out of the kernel source tree.
The respective device tree source overlay (DTSO) fragments are
overlay at the build time onto the base DTBs.

The DTBO configuration is done in the `conf/machine/<SoC>-<board>-<variant>.conf` file.

The following example shows the DTBO configuration:

# OUT_OF_KERNEL_DTSO - qcs6490-rb3gen2-core-kit.conf
    # Additional list of DTBOs to be overlaid on top of base kernel devicetree files
    # Format - KERNEL_TECH_DTBOS[<base-dtb-name>] = "<dtbo1 <dtbo2> ..."
    # For example:
    
     KERNEL_TECH_DTBOS[qcs6490-addons-rb3gen2] = " \
     qcm6490-graphics.dtbo qcm6490-wlan-rb3.dtbo \
     qcm6490-display-rb3.dtbo qcm6490-bt.dtbo \
     qcm6490-video.dtbo qcm6490-wlan-upstream.dtbo \
     "
    Copy to clipboard

## Manage out-of-tree kernel modules

Most of the kernel drivers are compiled from upstream kernel sources.
However, some drivers are maintained outside the kernel source tree and
are built as kernel modules using the Yocto build system.

In the following example, Bluetooth is an out-of-tree kernel module. The
recipe is located at `recipes-connectivity/bt_dlkm_kernel/bt-dlkm-kernel_git.bb`
compiles the driver as a kernel module. To autoload the kernel module
on boot, you can add the module name to the `KERNEL_MODULE_AUTOLOAD`
variable.

# Example out-of-tree Kernel module recipe
    DESCRIPTION = "QCOM BT drivers"
    LICENSE = "GPL-2.0-only"
    LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/${LICENSE};md5=801f80980d171dd6425610833a22dbe6"
    
    inherit module
    
    SRC_URI += "git://git.codelinaro.org/clo/le/platform/vendor/qcom-opensource/bt-kernel.git;protocol=https;rev=9e5cf29625d60f78e88440c94d096a9139445c00;branch=bt-performant.qclinux.1.0.r1-rel \
               file://bt_dlkm \
               file://bt_dlkm.service \
               "
    
    S = "${WORKDIR}/git"
    
    RPROVIDES:${PN} += "kernel-module-bt-kernel"
    
    EXTRA_OEMAKE += "MACHINE='${MACHINE}'"
    MAKE_TARGETS = "modules"
    MODULES_INSTALL_TARGET = "modules_install"
    # Kernel module to be autoloaded
    KERNEL_MODULE_AUTOLOAD += "bt_fm_slim"
    Copy to clipboard

## Build device image

Use the following Yocto commands to build the full image and kernel:

# setup the build environment
    $ export SHELL=/bin/bash
    
    $ source setup-environment
    # (select "<SoC> meta-qcom" → Enter → select "qcom-wayland meta-qcom-distro" → Enter)
    
    # build qcom linux console image
    $ bitbake qcom-console-image
    
    # Build kernel only
    $ bitbake linux-qcom-base
    
    # Build Images are produced under
    # build-qcom-wayland/tmp-glibc/deploy/images/<SoC>-<board>-<variant>/qcom-console-image/
    Copy to clipboard

For more information on how to build different images for SoC
supported Qualcomm distribution, see [Kernel configurations](https://docs.qualcomm.com/doc/80-70015-3/topic/features.html#kernel-configuration-1).

Note

To build a custom BSP, use `linux-qcom-custom`.

## Bring up the device

The `efi.bin` file contains the systemd-boot (boot manager), kernel,
and initramfs images. The Yocto build packs these images into the
`efi.bin` that is flashed to the EFI system partition (ESP) to
boot the device.

Device tree blobs are updated or added to the `KERNEL_DEVICETREE`
variable in the `conf/machine/<SoC>-<board>-<variant>.conf` file.
These device tree blobs are used to compile the `dtb.bin` file.

Flash the `efi.bin` and `dtb.bin` images using the following fastboot commands:

# Bring the device in fastboot mode
    # cd to the source root location
    $ cd build-qcom-wayland/tmp-glibc/deploy/images/<SoC>/qcom-console-image
    $ fastboot flash efi efi.bin
    $ fastboot flash dtb_a dtb.bin
    $ fastboot reboot
    Copy to clipboard

After the Qualcomm Linux build is generated, the kernel build is completed and the
kernel-related images are created in the
`tmp-glibc/deploy/images/<SoC>-<board>-<variant>/` directory.

The following table lists the build artifacts related to the kernel:

Table : Kernel build artifacts

| Image | Image name | Build deploy path | Details |
| --- | --- | --- | --- |
| Kernel executable and linking format (ELF) | vmlinux<br>    Copy to clipboard | temp-glibc/deploy/images/<SoC>-<board>-<variant>/<br>    Copy to clipboard | Output kernel ELF with debug symbols. |
| Initramfs | initramfs-qcom-image-<SoC>-<board>-<variant>.cpio.gz<br>    Copy to clipboard | tmp-glibc/deploy/images/<SoC>-<board>-<variant>/<br>    Copy to clipboard | Initramfs in copy in, copy out (CPIO) file format. |
| Kernel image | Image<br>    Copy to clipboard | tmp-glibc/deploy/images/<SoC>-<board>-<variant>/<br>    Copy to clipboard | Kernel raw image binary, systemd-boot does not support compressed images. |
| Kernel modules | Different kernel dynamically loadable kernel modules (DLKMs)<br><br><br>modules-<SoC>-<board>-<variant>.tgz<br>    Copy to clipboard | tmp-glibc/deploy/images/<SoC>-<board>-<variant>/<br>    Copy to clipboard | Kernel drivers modules. |
| Device tree blobs | <SoC>-addons-<VARIANT>.dtb<br>    Copy to clipboard | tmp-glibc/deploy/images/<SoC>-<board>-<variant>/<br>    Copy to clipboard | Individual device tree blobs. |
| ESP partition | efi.bin<br>    Copy to clipboard | tmp-glibc/deploy/images/<SoC>-<board>-<variant>/<br>    Copy to clipboard | All required boot images including systemd-boot, kernel, and initramfs are packaged into the extensible firmware interface (`efi.bin`) binary. |
| DTB partition | dtb.bin<br>    Copy to clipboard | tmp-glibc/deploy/images/<SoC>-<board>-<variant>/<br>    Copy to clipboard | All the DTBO files are merged into (`dtb.bin`) binary. |

Last Published: Oct 15, 2024

[Previous Topic
Overview](https://docs.qualcomm.com/bundle/publicresource/80-70015-3/topics/overview.md) [Next Topic
Features](https://docs.qualcomm.com/bundle/publicresource/80-70015-3/topics/features.md)