> ## 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.

# Build Qualcomm Linux using Yocto

This page is intended for users who want to build Qualcomm Linux from scratch
using the Yocto Project. It introduces the key Yocto concepts required for the
build and walks through the overall workflow—from configuration to execution.

## **Host System Requirements**

* Configuration
  * x86 machine
  * Quad-core CPU, for example, Intel i7-2600 at 3.4 GHz (equivalent or better)
  * 300 GB free disk space (swap partition > 32 GB)
  * 16 GB RAM
* Tools
  * Git 1.8.3.1 or later versions
  * Tar 1.28 or later versions
  * Python 3.10.2 or later versions
  * GCC 10.1 or later versions
  * GNU Make 4.0 or later versions
  * Kas 4.8 or later versions
* Permissions
  * `sudo` permission is required to run a few commands

## **Host Setup**

The following instructions are intended for use on a Ubuntu host system. The
Yocto build is also supported on other [distributions](https://docs.yoctoproject.org/ref-manual/system-requirements.html#supported-linux-distributions)
compatible with Yocto, but no validation is performed against them.

* Install the following packages to prepare your host environment for the Yocto build

  ```bash theme={null}
  sudo apt update
  sudo apt install build-essential chrpath cpio debianutils diffstat \
       file gawk gcc git iputils-ping libacl1 locales python3 python3-git \
       python3-jinja2 python3-pexpect python3-pip python3-subunit socat \
       texinfo unzip wget xz-utils zstd
  ```

* Qualcomm uses the `kas` tool to sync and build the Yocto project. Use
  the following commands to install `kas` on your system

  <Note>
    On older Ubuntu versions, the `kas` version provided by the system package
    manager may be outdated. Using `pipx` is the recommended way to install kas.
  </Note>

  ```bash theme={null}
   sudo apt install pipx

   # Restart your shell session after running this command to ensure
   # path changes take effect
   pipx ensurepath

   # The kas version is expected to be 4.8 or higher
   pipx install "kas>=4.8"
  ```

## **kas configuration model**

Qualcomm uses the `kas` tool to sync and build the Yocto project. The `kas` configuration model uses YAML files to declare which layers, machines, and distributions to include in a build. These YAML files are located in the `meta-qcom/ci/` directory.

A typical `kas` build command combines:

* A machine YAML file (e.g., `meta-qcom/ci/iq-9075-evk.yml`)
* A distribution YAML file (e.g., `meta-qcom/ci/qcom-distro.yml`)

```text theme={null}
kas shell meta-qcom/ci/<machine-name>.yml:meta-qcom/ci/<distro-name>.yml
```

## **Selecting MACHINE, DISTRO, and image**

The following table lists the supported `MACHINE`, `DISTRO`, and image recipe combinations. Use these values with the `kas shell` command to set up the build environment, then run `bitbake <image recipe>` to build.

| **MACHINE configuration**                                                                                                 | **Supported DISTRO**                                                                                                    | **Image recipe**                                                                      |
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| <ul><li>`iq-615-evk.conf`</li><li>`iq-8275-evk.conf`</li><li>`qcm6490-idp.conf`</li><li>`rb3gen2-core-kit.conf`</li></ul> | <ul><li>`qcom-distro`</li><li>`qcom-distro-catchall`</li><li>`qcom-distro-selinux`</li><li>`qcom-distro-sota`</li></ul> | <ul><li>`qcom-multimedia-image`</li><li>`qcom-multimedia-proprietary-image`</li></ul> |
| <ul><li>`iq-9075-evk.conf`</li></ul>                                                                                      | <ul><li>`qcom-distro`</li><li>`qcom-distro-catchall`</li><li>`qcom-distro-selinux`</li><li>`qcom-distro-sota`</li></ul> | <ul><li>`qcom-multimedia-image`</li><li>`qcom-multimedia-proprietary-image`</li></ul> |

## Configuration Parameters

The following table describes the build tags for the current release. These
values will be need to be substituted in the build commands.

| Release Tag           | Identifier |
| --------------------- | ---------- |
| meta-qcom-release-tag | qli-2.0    |

## **Build Instructions**

* Download Qualcomm's Yocto layer `meta-qcom`. For the latest
  `<meta-qcom-release-tag>`, see [Configuration Parameters](#configuration-parameters).

  ```bash theme={null}
  git clone https://github.com/qualcomm-linux/meta-qcom -b <meta-qcom-release-tag>
  ```

- Build the software image using `kas`. You define build targets based
  on machine and distro combinations.

  <CodeGroup>
    ```bash IQ-9075-EVK theme={null}
    kas build meta-qcom/ci/iq-9075-evk.yml:meta-qcom/ci/qcom-distro.yml:meta-qcom/ci/performance.yml
    ```

    ```bash IQ-8275-EVK theme={null}
    kas build meta-qcom/ci/iq-8275-evk.yml:meta-qcom/ci/qcom-distro.yml:meta-qcom/ci/performance.yml
    ```

    ```bash IQ-615-EVK theme={null}
    kas build meta-qcom/ci/iq-615-evk.yml:meta-qcom/ci/qcom-distro.yml:meta-qcom/ci/performance.yml
    ```

    ```bash QCS6490 theme={null}
    kas build meta-qcom/ci/rb3gen2-core-kit.yml:meta-qcom/ci/qcom-distro.yml:meta-qcom/ci/performance.yml
    ```

    ```bash IQ-X7181-EVK theme={null}
    kas build meta-qcom/ci/iq-x7181-evk.yml:meta-qcom/ci/qcom-distro.yml:meta-qcom/ci/performance.yml
    ```

    ```bash IQ-X5121-EVK theme={null}
    kas build meta-qcom/ci/iq-x5121-evk.yml:meta-qcom/ci/qcom-distro.yml:meta-qcom/ci/performance.yml
    ```
  </CodeGroup>

  <Note>
    In some host machines `https://git.yoctoproject.org/git/meta-virtualization` may fail to clone. If you encounter this, configure Git to automatically redirect the URL to the working one:

    ```bash theme={null}
    git config --global url."https://git.yoctoproject.org/meta-virtualization".insteadOf \
        "https://git.yoctoproject.org/git/meta-virtualization"
    ```

    To verify the redirect is in place:

    ```bash theme={null}
    git config --global --get-regexp url
    ```
  </Note>

* The build creates a single tarball containing all the relevant files to
  perform a full clean flash, including partition metadata, boot firmware,
  ESP partition and the rootfs. After a successful build, check if the
  qcomflash tarball exists in the build artifacts. The following examples
  use `qcom-multimedia-proprietary-image` as the image name.

  <CodeGroup>
    ```bash IQ-9075-EVK theme={null}
    ls build/tmp/deploy/images/iq-9075-evk/qcom-multimedia-proprietary-image-iq-9075-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-8275-EVK theme={null}
    ls build/tmp/deploy/images/iq-8275-evk/qcom-multimedia-proprietary-image-iq-8275-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-615-EVK theme={null}
    ls build/tmp/deploy/images/iq-615-evk/qcom-multimedia-proprietary-image-iq-615-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash QCS6490 theme={null}
    ls build/tmp/deploy/images/rb3gen2-core-kit/qcom-multimedia-proprietary-image-rb3gen2-core-kit.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-X7181-EVK theme={null}
    ls build/tmp/deploy/images/iq-x7181-evk/qcom-multimedia-proprietary-image-iq-x7181-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-X5121-EVK theme={null}
    ls build/tmp/deploy/images/iq-x5121-evk/qcom-multimedia-proprietary-image-iq-x5121-evk.rootfs.qcomflash.tar.gz
    ```
  </CodeGroup>

## **Related topics**

* [How to build the mainline variant of meta-qcom](./how-to-build-meta-qcom-mainline)
* [How to build images in a containerized environment?](./how-to-build-meta-qcom-container)
* [How to build meta-qcom using the legacy repo manifest method](./how-to-build-repo-manifest)
* [How to build meta-qcom using the legacy meta-qcom-releases method](./how-to-build-meta-qcom-releases)
* [How to enable debug configuration in meta-qcom builds](./how-to-build-enable-debug-conf)
* [How to set up a shared cache for Yocto builds](./how-to-setup-shared-yocto-cache)
* [How to configure the storage type for a Yocto BSP build](./how-to-configure-storage-type)
* [How to increase system memory to avoid OOM errors](./how-to-increase-system-memory)
* [How to perform common tasks with kas](./how-to-perform-common-tasks)

## **Next steps**

\-- To learn more about the supported combinations for building Qualcomm Linux, see [Qualcomm Linux Release Notes](https://dragonwingdocs.qualcomm.com/Key-Documents/Software-Release-Notes/introduction).
\-- For detailed build instructions, see [Build from Source](https://dragonwingdocs.qualcomm.com/Key-Documents/Firmware-Guide/build-firmware).
