# 使用 GitHub 编译（未注册用户）

使用 GitHub 并使用预编译的专有二进制文件/镜像进行编译。

有关此编译方法支持的硬件 SoC 的更多详细信息，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-251013063244/)中的表 *Sync and build methods*。

## 主机要求

- 配置

    - x86 计算机
    - 至少四核 CPU，例如 Intel i7-2600 @ 3.4 GHz（同等或更高配置）
    - 300 GB 可用磁盘空间（swap 分区 &gt; 32 GB）
    - 16 GB RAM
    - Ubuntu 22.04
- 工具

    - Git 1.8.3.1 或更高版本
    - Tar 1.28 或更高版本
    - Python 3.10.2 或更高版本
    - GCC 8.0 或更高版本
    - GNU Make 4.0 或更高版本
- 权限

    - 运行一些命令需要 `sudo` 权限

Note

在虚拟机上编译代码是一个缓慢的过程，可能需要几个小时。Qualcomm 建议使用 Ubuntu 主机进行编译。要在 Microsoft^®^ Windows^®^ 或 Apple^®^ macOS^®^ 上搭建运行 Ubuntu 22.04 的虚拟机 (VM)，请参阅 [Qualcomm Linux 虚拟机搭建指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-41/)。

## 设置 Ubuntu 主机

在 Ubuntu 主机上安装并配置所需的软件工具。

1. 安装以下软件包，为 Yocto 编译准备主机环境：

sudo apt update
        sudo apt install repo gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool locales tar python-is-python3 file libxml-opml-simplegen-perl vim whiptail g++ libacl1
        Copy to clipboard
2. 设置语言区域（如果尚未设置）：

sudo locale-gen en_US.UTF-8
        sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
        export LC_ALL=en_US.UTF-8
        export LANG=en_US.UTF-8
        Copy to clipboard
3. 更新 git 配置：

# Check if your identity is configured in .gitconfig
        git config --get user.email
        git config --get user.name
        
        # Run the following commands if you don't have your account identity set in .gitconfig
        git config --global user.email <Your email ID>
        git config --global user.name <"Your Name">
        
        # Add the following UI color option for output of console (optional)
        git config --global color.ui auto
        
        # Add the following git configurations to fetch large size repositories and to avoid unreliable connections
        git config --global http.postBuffer 1048576000
        git config --global http.maxRequestBuffer 1048576000
        git config --global http.lowSpeedLimit 0
        git config --global http.lowSpeedTime 999999
        Copy to clipboard

## 同步

使用在 [Ubuntu 主机设置](https://docs.qualcomm.com/doc/80-70022-254Y/topic/github_workflow_unregistered_users.html#ubuntu-host-setup-github-unreg)期间安装的 Repo 工具从 [Qualcomm manifest](https://github.com/quic-yocto/qcom-manifest) 下载 git 代码仓库和其他属性。Repo 工具使用 `repo init` 命令下载 manifest。

下表展示了 Yocto 层与 manifest 发布标记的示例映射关系。使用此映射下载和编译 Qualcomm Linux。

不同 manifest 发布标记对应的 Yocto 层

| Yocto 层 | Manifest 发布标记 | 参考发行版（`DISTRO`） |
| --- | --- | --- |
| <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-hwe</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-distro</span></code></p></li><br></ul> | BSP build：高层操作系统和预编译固件（仅限 GPS）<br><br><br>`qcom-6.6.97-QLI.1.6-Ver.1.2.xml` | `qcom-wayland` |
| <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-hwe</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-distro</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-qim-product-sdk</span></code></p></li><br></ul> | BSP build + Qualcomm IM SDK build：<br><br><br>`qcom-6.6.97-QLI.1.6-Ver.1.2_qim-product-sdk-2.1.1.xml` | `qcom-wayland` |
| <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-hwe</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-distro</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-realtime</span></code></p></li><br></ul> | BSP build + 实时内核 build：<br><br><br>`qcom-6.6.97-QLI.1.6-Ver.1.2_realtime-linux-1.0.xml` | `qcom-wayland` |
| <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-hwe</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-distro</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-ros</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-robotics</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-robotics-distro</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-robotics-sdk</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">meta-qcom-qim-product-sdk</span></code></p></li><br></ul> | BSP build + QIR SDK build：<br><br><br>`qcom-6.6.97-QLI.1.6-Ver.1.2_robotics-sdk-1.2.xml` | `qcom-robotics-ros2-humble` |

发布标记的语法如下：

- Manifest 发布标记：

    `qcom-<Linux LTS Kernel Version>-QLI.<version>-Ver.<release>.xml`

    例如，manifest 发布标记 `qcom-6.6.97-QLI.1.6-Ver.1.2.xml` 表示以下内容：

    - 6.6.97：Qualcomm Linux 内核
    - QLI.1.6：Qualcomm Linux v1.6
    - 1.2：里程碑发布版本
- 其他产品化 manifest 发布标记：

    `qcom-<Linux LTS Kernel version>-QLI.<version>-Ver.<milestone release>_<product/customization>-<patch release>.xml`

    例如，其他产品化 manifest 发布标记 `qcom-6.6.97-QLI.1.6-Ver.1.2_qim-product-sdk-2.1.1.xml` 表示以下内容：

    - 6.6.97：Qualcomm Linux 内核
    - QLI.1.6：Qualcomm Linux v1.6
    - qim-product-sdk-2.1.1：基于 QLI.1.6 的 Qualcomm IM SDK 版本

        其他产品/定制示例：

        - *realtime-linux-1.0*
        - *robotics-sdk-1.1*
    - 1.2：里程碑发布版本
    - 2.1.1：与里程碑版本关联的 Patch 版本

有关 Yocto 层的更多信息，请参阅 [Qualcomm Linux 元数据层](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-27/qualcomm_linux_metadata_layers.html)。

## 编译 BSP 镜像

板级支持包 (BSP) 镜像编译包含用于 Qualcomm 设备支持的软件组件和适用于 Qualcomm SoC 的软件功能。此 build 包括 Qualcomm 开发套件的参考分发包配置。有关详细信息，请参阅 [Qualcomm Linux 元数据层](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-27/qualcomm_linux_metadata_layers.html)。

1. 下载 Qualcomm Yocto 和支持层。有关最新 `<manifest release tag>` 的信息，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-251013063244/)中的 *Build-Critical Release Tags* 章节。

# cd to directory where you have 300 GB of free storage space to create your workspaces
        mkdir <WORKSPACE_DIR>
        cd <WORKSPACE_DIR>
        repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linux-scarthgap -m <manifest release tag>
        # Example, <manifest release tag> is qcom-6.6.97-QLI.1.6-Ver.1.2.xml
        repo sync
        Copy to clipboard
2. 搭建编译环境：

MACHINE=<machine> DISTRO=qcom-wayland QCOM_SELECTED_BSP=<override> source setup-environment
        # Example, MACHINE=qcs6490-rb3gen2-vision-kit DISTRO=qcom-wayland QCOM_SELECTED_BSP=custom source setup-environment
        # source setup-environment: Sets the environment, creates the build directory build-qcom-wayland,
        # and enters into build-qcom-wayland directory.
        Copy to clipboard

    有关 `<machine>` 和 `<override>` 的不同组合，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-251013063244/)。
3. 编译软件镜像。有关支持的镜像配方，请参阅 [GitHub 工作流中支持的镜像配方](https://docs.qualcomm.com/doc/80-70022-254Y/topic/how_to.html#image-recipes-github-workflow)。

bitbake <image recipe>
        # Example, bitbake qcom-multimedia-image
        Copy to clipboard
4. 成功生成后，检查 `system.img` 文件是否位于 `<workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-multimedia-image` 目录中：

cd <workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-multimedia-image
        ls -al system.img
        Copy to clipboard

## 编译 Qualcomm IM SDK 镜像

Qualcomm® Intelligent Multimedia SDK (IM SDK) 是四个独立功能 SDK 的集合：Qualcomm IM SDK、Qualcomm® Neural Processing SDK、Qualcomm® AI Engine Direct SDK 和 Lite Runtime (LiteRT)。该 SDK 还包括可用于开发用例的示例应用程序。有关更多详情，请参阅 [Qualcomm IM SDK 快速入门](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-51)。

1. 下载 Qualcomm Yocto 和支持层。 Qualcomm IM SDK build 的 `<manifest release tag>` 与 BSP build 相同。将 Qualcomm IM SDK 层克隆到 BSP build 之上。有关最新 `<manifest release tag>` 的信息，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-251013063244/)中的 *Build-Critical Release Tags* 章节。

# cd to directory where you have 300 GB of free storage space to create your workspaces
        mkdir <WORKSPACE_DIR>
        cd <WORKSPACE_DIR>
        repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linux-scarthgap -m <manifest release tag>
        # Example, <manifest release tag> is qcom-6.6.97-QLI.1.6-Ver.1.2.xml
        repo sync
        Copy to clipboard
2. 将 Qualcomm IM SDK 层克隆到工作区：

git clone https://github.com/quic-yocto/meta-qcom-qim-product-sdk -b <meta-qcom-qim-product-sdk release tag> layers/meta-qcom-qim-product-sdk
        # Example, <meta-qcom-qim-product-sdk release tag> is qcom-6.6.97-QLI.1.6-Ver.1.2_qim-product-sdk-2.1.1
        Copy to clipboard
3. 导出 Qualcomm IM SDK 层：

export EXTRALAYERS="meta-qcom-qim-product-sdk"
        Copy to clipboard
4. 搭建编译环境：

MACHINE=<machine> DISTRO=qcom-wayland QCOM_SELECTED_BSP=custom source setup-environment
        # Example, MACHINE=qcs6490-rb3gen2-vision-kit DISTRO=qcom-wayland QCOM_SELECTED_BSP=custom source setup-environment
        # source setup-environment: Sets the environment, creates the build directory build-qcom-wayland,
        # and enters into build-qcom-wayland directory.
        Copy to clipboard

    要了解 `MACHINE` 的取值，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-251013063244/)。
5. 编译软件镜像：

bitbake qcom-multimedia-image
        # Build SDK image
        bitbake qcom-qim-product-sdk
        Copy to clipboard
6. 成功生成后，检查 `system.img` 文件是否位于 `<workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-multimedia-image` 目录中：

cd <workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-multimedia-image
        ls -al system.img
        Copy to clipboard

## 编译 QIR SDK 镜像

Qualcomm® Intelligent Robotics (QIR) SDK 2.0 是一个组件集，可使您在 Qualcomm 平台上进行机器人特性的开发。此 SDK 适用于 Qualcomm Linux 发行版本。有关详细信息，请参阅 [QIR SDK 2.0 用户指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-265)。

1. 下载 Qualcomm Yocto 和支持层。QIR SDK build 的 `<manifest release tag>` 与 BSP build 相同。将 QIR SDK 层克隆到 BSP build 之上。有关最新 `<manifest release tag>` 的信息，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-251013063244/)中的 *Build-Critical Release Tags* 章节。

# cd to directory where you have 300 GB of free storage space to create your workspaces
        mkdir <WORKSPACE_DIR>
        cd <WORKSPACE_DIR>
        repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linux-scarthgap -m <manifest release tag>
        # Example, <manifest release tag> is qcom-6.6.97-QLI.1.6-Ver.1.2.xml
        repo sync
        Copy to clipboard
2. 将 QIR SDK 层下载到 BSP build `<WORKSPACE DIR>` 目录中：

git clone https://github.com/ros/meta-ros -b scarthgap layers/meta-ros && cd layers/meta-ros && git checkout c560699e810e60a9526f4226c2c23f8d877280c8 && cd ../../
        git clone https://github.com/quic-yocto/meta-qcom-robotics.git -b qcom-6.6.97-QLI.1.6-Ver.1.2_robotics-sdk-1.2 layers/meta-qcom-robotics
        git clone https://github.com/quic-yocto/meta-qcom-robotics-distro.git -b qcom-6.6.97-QLI.1.6-Ver.1.2_robotics-sdk-1.2 layers/meta-qcom-robotics-distro
        git clone https://github.com/quic-yocto/meta-qcom-robotics-sdk.git -b qcom-6.6.97-QLI.1.6-Ver.1.2_robotics-sdk-1.2 layers/meta-qcom-robotics-sdk
        git clone https://github.com/quic-yocto/meta-qcom-qim-product-sdk -b qcom-6.6.97-QLI.1.6-Ver.1.2_qim-product-sdk-2.1.1 layers/meta-qcom-qim-product-sdk
        Copy to clipboard
3. 搭建编译环境：

ln -s layers/meta-qcom-robotics-distro/set_bb_env.sh ./setup-robotics-environment
        ln -s layers/meta-qcom-robotics-sdk/scripts/qirp-build ./qirp-build
        MACHINE=<machine> DISTRO=qcom-robotics-ros2-humble QCOM_SELECTED_BSP=<override> source setup-robotics-environment
        # Example, MACHINE=qcs6490-rb3gen2-vision-kit DISTRO=qcom-robotics-ros2-humble QCOM_SELECTED_BSP=custom source setup-robotics-environment
        # source setup-robotics-environment: Sets the environment, creates the build directory build-qcom-robotics-ros2-humble,
        # and enters into build-qcom-robotics-ros2-humble directory.
        Copy to clipboard

    有关 `<machine>` 和 `<override>` 的不同组合，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-251013063244/)。
4. 编译机器人镜像和 QIR SDK artifact：

../qirp-build qcom-robotics-full-image
        Copy to clipboard
5. 编译成功后，请检查 QIR SDK build artifact 是否位于以下路径：

QIR SDK artifacts: <WORKSPACE DIR>/build-qcom-robotics-ros2-humble/tmp-glibc/deploy/qirpsdk_artifacts/qirp-sdk_<version>.tar.gz
        # system.img is present in the following path
        Robotics image: <WORKSPACE DIR>/build-qcom-robotics-ros2-humble/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-robotics-full-image
        Copy to clipboard

## 编译实时 Linux 镜像

实时层提供将 Qualcomm Linux 内核作为实时内核运行所需的配方和配置。实时内核运行时，通过配置完全启用抢占功能，`CONFIG_PREEMPT_RT=y`。该层支持 `linux-kernel-qcom-rt` 配方。它可以为支持的机器获取并编译 Qualcomm Linux 内核。这一层基于内核版本附加到内核和上游 `PREEMPT_RT` 的补丁，并启用实时配置。有关详细信息，请参阅[实时内核](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-3/real_time_kernel_overview.html)。

1. 下载 Qualcomm Yocto 和支持层。`<manifest release tag>` 实时 Linux 镜像与 BSP 编译相同。在 BSP 编译之上克隆实时 Linux。有关最新 `<manifest release tag>` 的信息，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-251013063244/)中的 *Build-Critical Release Tags* 章节。

# cd to directory where you have 300 GB of free storage space to create your workspaces
        mkdir <WORKSPACE_DIR>
        cd <WORKSPACE_DIR>
        repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linux-scarthgap -m <manifest release tag>
        # Example, <manifest release tag> is qcom-6.6.97-QLI.1.6-Ver.1.2.xml
        repo sync
        Copy to clipboard
2. 将实时 Linux 层克隆到工作区中：

git clone https://github.com/quic-yocto/meta-qcom-realtime -b <meta-qcom-realtime release tag> layers/meta-qcom-realtime
        # Example, <meta-qcom-realtime release tag> is qcom-6.6.97-QLI.1.6-Ver.1.2_realtime-linux-1.0
        Copy to clipboard
3. 编译实时层：

export EXTRALAYERS="meta-qcom-realtime"
        Copy to clipboard
4. 搭建编译环境：

MACHINE=<machine> DISTRO=qcom-wayland QCOM_SELECTED_BSP=<override> source setup-environment
        # Example, MACHINE=qcs6490-rb3gen2-vision-kit DISTRO=qcom-wayland QCOM_SELECTED_BSP=custom source setup-environment
        # source setup-environment: Sets the environment, creates the build directory build-qcom-wayland,
        # and enters into build-qcom-wayland directory.
        Copy to clipboard

    有关 `<machine>` 和 `<override>` 的不同组合，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-251013063244/)。
5. 编译软件镜像：

bitbake qcom-multimedia-image
        Copy to clipboard
6. 成功生成后，检查 `system.img` 文件是否位于 `<workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-multimedia-image` 目录中：

cd <workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-multimedia-image
        ls -al system.img
        Copy to clipboard

## 刷写

要将软件镜像刷写到设备，请参阅[刷写软件镜像](https://docs.qualcomm.com/doc/80-70022-254Y/topic/flash_images.html#flash-images)。

## 相关主题

- [连接到 UART shell](https://docs.qualcomm.com/doc/80-70022-254Y/topic/how_to.html#connect-uart)
- [连接到网络](https://docs.qualcomm.com/doc/80-70022-254Y/topic/how_to.html#connect-to-network)
- [使用 SSH 登录](https://docs.qualcomm.com/doc/80-70022-254Y/topic/how_to.html#use-ssh)
- [同步、编译和刷写问题排查](https://docs.qualcomm.com/doc/80-70022-254Y/topic/troubleshoot_sync_build_and_flash.html#troubleshoot-sync-build-and-flash)

Last Published: Nov 04, 2025

[Previous Topic
使用 QSC CLI 编译](https://docs.qualcomm.com/bundle/publicresource/80-70022-254Y/topics/build_frm_source_qsc_cli.md) [Next Topic
使用 GitHub 编译（注册用户）](https://docs.qualcomm.com/bundle/publicresource/80-70022-254Y/topics/build_from_source_github_intro.md)