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

# 启用调试配置

本节介绍如何使用 Yocto 设置启用并构建调试镜像。本内容面向需要更深入了解系统行为、进行故障排除和内核级调试的开发者。

要生成调试构建，只需在构建命令中包含 `debug.yml` kas 配置片段，即可启用 `DEBUG_BUILD=1` 配置。要了解当 `DEBUG_BUILD` 设置为 1 时使用哪些内核 defconfig 和配置片段，请参阅[内核配方](./meta-qcom#kernel-recipes)。

## 配置参数

下表描述了当前版本的构建标签。这些值需要替换到构建命令中。

| 发布标签                  | 标识符     |
| --------------------- | ------- |
| meta-qcom-release-tag | qli-2.0 |

## 构建说明

* 下载 Qualcomm 的 Yocto 层 `meta-qcom`。有关最新的 `<meta-qcom-release-tag>`，请参阅[配置参数](#configuration-parameters)。

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

- 使用 `kas` 构建软件镜像。您可以基于机器和发行版组合定义构建目标。

  <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/debug.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/debug.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/debug.yml
    ```

    ```bash QCS6490 theme={null}
    kas build meta-qcom/ci/rb3gen2-core-kit.yml:meta-qcom/ci/qcom-distro.yml:meta-qcom/ci/debug.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/debug.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/debug.yml
    ```
  </CodeGroup>

* 构建会生成一个 tarball，其中包含执行一次完整全新刷写所需的所有相关文件，包括分区元数据、启动固件、ESP 分区和 rootfs。构建成功后，请检查构建产物中是否存在 qcomflash tarball。以下示例使用 `qcom-multimedia-proprietary-image` 作为镜像名称。

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

## 后续步骤

* 有关包含内核代码片段详情的完整调试构建指南，请参阅[创建用于调试的构建](./create-a-build-for-debugging)。
* 有关镜像中可用的调试工具，请参阅[调试工具](./debug-tools)。
* 有关一般 Yocto 构建调试，请参阅[调试 Yocto 构建](./debug)。
