# 非注册用户的 GitHub 工作流程

以下章节介绍如何使用 GitHub 并使用预编译的专有二进制文件/镜像进行编译。

Note

要了解此编译方法支持的硬件 SoC，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-241225194606/)中的*同步和编译方法表*。

## 主机要求

| 配置 | 工具 | 权限 |
| --- | --- | --- |
| x86 计算机 | Git 1.8.3.1 或更高版本 | 运行一些命令需要 `sudo` 权限 |
| 至少四核 CPU，例如 Intel i7-2600 @ 3.4 GHz（同等或更高配置） | Tar 1.28 或更高版本 | 运行一些命令需要 `sudo` 权限 |
| 300 GB 可用磁盘空间（swap分区 &gt; 32 GB） | Python 3.10.2 或更高版本 | 运行一些命令需要 `sudo` 权限 |
| 16 GB RAM | GCC 7.5 或更高版本 | 运行一些命令需要 `sudo` 权限 |
| Ubuntu 22.04 | GNU Make 4.0 或更高版本 | 运行一些命令需要 `sudo` 权限 |
|  |  |  |
|  |  |  |
|  |  |  |
|  |  |  |

Note

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

## 使用独立命令编译

### 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++
        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 do not 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-70017-254Y/topic/github_workflow_unregistered_users.html#section-twd-1bv-xbc-vinayjk-07-02-24-2039-30-667)中的 Repo 工具从 [Qualcomm manifest](https://github.com/quic-yocto/qcom-manifest) 下载 git 存储库和其他属性。Repo 工具使用 `repo init` 命令下载manifest。

下表显示了 Yocto 层到用于下载和编译 Qualcomm Linux 的 manifest release tag 的示例映射：

将 Yocto 层映射到 manifest release tags

| Yocto 层 | Manifest release tag | 参考发行版（`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.52-QLI.1.3-Ver.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-qim-product-sdk</span></code></p></li><br></ul> | BSP build + QIMP SDK build：<br><br><br>`qcom-6.6.52-QLI.1.3-Ver.1.1_qim-product-sdk-1.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-realtime</span></code></p></li><br></ul> | BSP build + 实时内核build：<br><br><br>`qcom-6.6.52-QLI.1.3-Ver.1.1_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 + QIRP SDK build：<br><br><br>`qcom-6.6.52-QLI.1.3-Ver.1.1_robotics-product-sdk-1.1.xml` | `qcom-robotics-ros2-humble` |

Note

- manifest release tag 的语法：

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

    例如，manifest release tag `qcom-6.6.52-QLI.1.3-Ver.1.1.xml` 表示以下内容：

    - 6.6.52：Qualcomm Linux 内核
    - QLI.1.3：Qualcomm Linux v1.3
    - 1.1：里程碑发布版本
- 其他产品化 manifest 发布标记的语法：

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

    例如，其他产品化 manifest 发布标记 `qcom-6.6.52-QLI.1.3-Ver.1.1_qim-product-sdk-1.1.2.xml` 表示以下内容：

    - 6.6.52：Qualcomm Linux 内核
    - QLI.1.3：Qualcomm Linux v1.3
    - qim-product-sdk-1.1.2：基于 QLI.1.3 的 QIMP SDK 版本

        其他产品/定制示例：

        - *实时-linux-1.0*
        - *机器人-产品-sdk-1.1*
    - 1.0：里程碑发布版本
    - 1.1：与里程碑发布版本相关的补丁发布版本
- 有关 Yocto 层的更多信息，请参阅 [Qualcomm Linux 元数据层和说明](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-27/platform_software_features.html#qualcomm-linux-metadata-layers-overview)。

### 编译 BSP 镜像

板卡支持包（BSP）镜像 build 包含用于 Qualcomm 设备支持的软件组件和适用于 Qualcomm SoC 的增值软件特性。它包括 Qualcomm 开发套件的参考分布配置。

有关详细信息，请参阅 [Qualcomm Linux 元数据层](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-27/platform_software_features.html#qualcomm-linux-metadata-layers-overview)。

1. 下载 Qualcomm Yocto 和支持层：

# 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-kirkstone -m <manifest release tag>
        # Example, <manifest release tag> is qcom-6.6.52-QLI.1.3-Ver.1.1.xml
        repo sync
        Copy to clipboard

Note

有关最新 `<manifest release tag>` 的信息，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-241225194606/)中的 *Build-Critical Release Tags* 部分。
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

Note

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

Note

有关支持的镜像配方，请参阅 [GitHub 工作流中支持的镜像配方](https://docs.qualcomm.com/doc/80-70017-254Y/topic/how_to.html#section-x3c-n5l-zbc-vinayjk-07-08-24-1744-58-455)。

bitbake <image recipe>
        # Example, bitbake qcom-multimedia-image
        Copy to clipboard

    成功生成后，检查 `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

### 编译 QIMP SDK 镜像

Qualcomm® Intelligent Multimedia Product （QIMP）SDK 是四个独立功能 SDK 的集合，分别是 Qualcomm® Intelligent Multimedia SDK（IM SDK）、Qualcomm® Neural Processing SDK、Qualcomm® AI Engine Direct SDK 和 LiteRT。其中还包括可用于开发用例的示例程序。

有关详细信息，请参阅 [QIMP SDK 快速入门指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-51)。

1. 下载 Qualcomm Yocto 和支持层：

Note

    - `<manifest release tag>` QIMP SDK build 与 BSP build 相同。在 BSP build 上克隆 QIMP SDK 层。
    - 有关最新 `<manifest release tag>` 的信息，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-241225194606/)中的 *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-kirkstone -m <manifest release tag>
        # Example, <manifest release tag> is qcom-6.6.52-QLI.1.3-Ver.1.1.xml
        repo sync
        Copy to clipboard
2. 将 QIMP 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.52-QLI.1.3-Ver.1.1_qim-product-sdk-1.1.2
        Copy to clipboard

    要编译 QIMP SDK 层，需要进行以下export操作：

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

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

Note

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

bitbake qcom-multimedia-image
        # Build SDK image
        bitbake qcom-qim-product-sdk
        Copy to clipboard

    成功生成后，检查 `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

### 编译 QIRP SDK 镜像

Qualcomm® Intelligent Robotics Product (QIRP) SDK 2.0 是一个组件集，可使您在 Qualcomm 平台上进行机器人特性的开发。此 SDK 适用于 Qualcomm Linux 发行版本。

有关详细信息，请参阅 [QIRP SDK 2.0 用户指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-265)。

1. 下载 Qualcomm Yocto 和支持层：

Note

`<manifest release tag>` 对 QIRP SDK 编译与 BSP 编译相同。在 BSP 编译之上克隆 QIRP SDK 层。

# 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-kirkstone -m <manifest release tag>
        # Example, <manifest release tag> is qcom-6.6.52-QLI.1.3-Ver.1.1.xml
        repo sync
        Copy to clipboard

Note

有关最新 `<manifest release tag>` 的信息，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-241225194606/)中的 *Build-Critical Release Tags* 部分。
2. 将 QIRP SDK 层下载到 BSP 编译 `<WORKSPACE DIR>` 目录：

git clone https://github.com/ros/meta-ros -b kirkstone layers/meta-ros
        git clone https://github.com/quic-yocto/meta-qcom-robotics.git layers/meta-qcom-robotics
        git clone https://github.com/quic-yocto/meta-qcom-robotics-distro.git layers/meta-qcom-robotics-distro
        git clone https://github.com/quic-yocto/meta-qcom-robotics-sdk.git layers/meta-qcom-robotics-sdk
        git clone https://github.com/quic-yocto/meta-qcom-qim-product-sdk 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

Note

有关各种 `<machine>` 和 `<override>` 组合，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-241225194606/)。
4. 编译 robotics 镜像和 QIRP SDK artifacts：

../qirp-build qcom-robotics-full-image
        Copy to clipboard

    成功生成后，请检查 QIRP SDK 编译 artifacts 是否位于以下路径：

QIRP 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-70017-3/features.html#real-time-rt-kernel-overview)。

1. 下载 Qualcomm Yocto 和支持层：

Note

`<manifest release tag>` 实时 Linux 镜像与 BSP 编译相同。在 BSP 编译之上克隆实时 Linux。

# 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-kirkstone -m <manifest release tag>
        # Example, <manifest release tag> is qcom-6.6.52-QLI.1.3-Ver.1.1.xml
        repo sync
        Copy to clipboard

Note

有关最新 `<manifest release tag>` 的信息，请参阅[发布说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-241225194606/)中的 *Build-Critical Release Tags* 部分。
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.52-QLI.1.3-Ver.1.1_realtime-linux-1.0
        Copy to clipboard

    要编译实时层，需要进行以下导出操作：

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

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

Note

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

bitbake qcom-multimedia-image
        Copy to clipboard

    成功生成后，检查 `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-70017-254Y/topic/flash_images.html#flash-images)。

Last Published: Jan 24, 2025

[Previous Topic
使用 QSC CLI 编译](https://docs.qualcomm.com/bundle/publicresource/80-70017-254Y/topics/build_from_source_QSC_CLI.md) [Next Topic
注册用户的 GitHub 工作流程](https://docs.qualcomm.com/bundle/publicresource/80-70017-254Y/topics/build_from_source_github_intro.md)

Source: [https://docs.qualcomm.com/doc/80-70017-254Y/topic/github_workflow_unregistered_users.html](https://docs.qualcomm.com/doc/80-70017-254Y/topic/github_workflow_unregistered_users.html)