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

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

以下章节提供了使用 GitHub 基于预编译的专有二进制镜像进行编译的说明。

## 主机要求

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

| 配置 | 配置 | 配置 | 工具 | 权限 |
| --- | --- | --- | --- | --- |
| **Linux** | **Windows** | **MAC** | 工具 | 权限 |
| x86 机器 | x86 机器 | x86/Arm^®^ 机器 | Git 1.8.3.1 或更高版本 | 有些命令在执行时需要 `sudo` 权限。 |
| 至少四核 CPU，例如 Intel i7-2600 @ 3.4 GHz（同等或更高配置） | 16 核 CPU | 16 核 CPU | Git 1.8.3.1 或更高版本 | 有些命令在执行时需要 `sudo` 权限。 |
| 300 GB 可用磁盘空间（交换分区 &gt; 32 GB） | 300 GB 可用磁盘空间，供 VirtualBox VM 使用 | 300 GB 可用磁盘空间，供 UTM 使用 | Python 3.10.2 或更高版本 | 有些命令在执行时需要 `sudo` 权限。 |
| 16 GB RAM | 16 GB RAM | 16 GB RAM | GCC 7.5 或更高版本 | 有些命令在执行时需要 `sudo` 权限。 |
| Ubuntu 22.04 | Microsoft Windows 11 操作系统 | Apple^®^ Mac^®^ OS 14 | GNU Make 4.0 或更高版本 | 有些命令在执行时需要 `sudo` 权限。 |
|  |  |  |  |  |
|  |  |  |  |  |
|  |  |  |  |  |
|  |  |  |  |  |

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

## 使用独立命令编译

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

### 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 whiptailCopy 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-8Copy 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 999999Copy to clipboard

### 同步

本节使用上一节中安装的 Repo 工具从 [Qualcomm manifest](https://github.com/quic-yocto/qcom-manifest) 中下载 git 代码仓库列表和其他配置文件。作为此过程的一部分，它会下载 `repo init` 命令中使用的 manifest。

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

| Yocto 层 | Manifest release tag | 发行版 (`DISTRO`) |
| --- | --- | --- |
| <ul class="ul" id="build_with_standalone_commands_unreg__ul_b5j_xrl_qbc_vinayjk_06-06-24-1307-46-325"><br>                                    <li class="li"><code class="ph codeph">meta-qcom</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-qcom-hwe</code></li><br><br>                                </ul> | 基础版本：High-level OS 和预编译固件（仅限 GPS）<br><br><br>                                <br>`qcom-6.6.28-QLI.1.1-Ver.1.1.xml` | `qcom-wayland` |
| <ul class="ul" id="build_with_standalone_commands_unreg__ul_c5j_xrl_qbc_vinayjk_06-06-24-1307-46-325"><br>                                    <li class="li"><code class="ph codeph">meta-qcom</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-qcom-hwe</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-qcom-qim-product-sdk</code></li><br><br>                                </ul> | 基础版本 + QIMP SDK 版本：<br><br><br>                                <br>`qcom-6.6.28-QLI.1.1-Ver.1.1_qim-product-sdk-1.1.3.xml` | `qcom-wayland` |
| <ul class="ul" id="build_with_standalone_commands_unreg__ul_az4_njb_wbc_vinayjk_06-26-24-1355-19-162"><br>                                    <li class="li"><code class="ph codeph">meta-qcom</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-qcom-hwe</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-qcom-realtime</code></li><br><br>                                </ul> | 基础版本 + 实时内核版本：<br><br><br>                                <br>`qcom-6.6.28-QLI.1.1-Ver.1.1_realtime-linux-1.0.xml` | `qcom-wayland` |
| <ul class="ul" id="build_with_standalone_commands_unreg__ul_rlp_q2t_qbc_vinayjk_06-07-24-1350-57-451"><br>                                    <li class="li"><code class="ph codeph">meta-qcom</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-qcom-hwe</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-ros</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-qcom-robotics</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-qcom-robotics-distro</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-qcom-robotics-sdk</code></li><br><br>                                    <li class="li"><code class="ph codeph">meta-qcom-qim-product-sdk</code></li><br><br>                                </ul> | 基础版本 + QIRP SDK 版本：<br><br><br>                                <br>`qcom-6.6.28-QLI.1.1-Ver.1.1_robotics-product-sdk-1.1.xml` | `qcom-robotics-ros2-humble` |

有关 Yocto 层的说明，参见[Table : Qualcomm Linux Yocto 层](https://docs.qualcomm.com/doc/80-70014-254Y/topic/build_from_source_qsc_gui_intro.html#concept_n2t_tjn_w1c__Yocto_layer_descriptions)。

### 编译基础镜像

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.28-QLI.1.1-Ver.1.1.xml
        repo syncCopy to clipboard

Note: 有关最新的 `<manifest release tag>`，参见[发行说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-240626095531/)中的<cite class="cite">编译关键发布标签</cite>部分。
2. 搭建编译环境：

        MACHINE=qcm6490 DISTRO=qcom-wayland source setup-environment
        # source setup-environment: Sets the environment settings, creates the build directory build-qcom-wayland,
        # and enters into build-qcom-wayland directory.Copy to clipboard
3. 编译软件镜像：
Note: 有关支持的镜像配方，参见 [GitHub 工作流程支持哪些镜像配方？](https://docs.qualcomm.com/doc/80-70014-254Y/topic/how_to.html#howto_build__section_x3c_n5l_zbc_vinayjk_07-08-24-1744-58-455)部分。

        bitbake <image recipes>
        bitbake qcom-multimedia-imageCopy to clipboard

编译成功后，可以检查 `system.img` 是否位于 `<workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcm6490/qcom-multimedia-image` 目录中：

        cd <workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcm6490/qcom-multimedia-image
        ls -al system.imgCopy to clipboard

### 编译 QIMP SDK 镜像

1. 下载 Qualcomm Yocto 和支持层：
Note: QIMP SDK 版本的 `<manifest release tag>` 与基础版本相同。必须在基础编译版本之上克隆 QIMP SDK 层。
有关最新的 `<manifest release tag>`，参见[发行说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-240626095531/)中的<cite class="cite">编译关键发布标签</cite>部分。

        # 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.28-QLI.1.1-Ver.1.1.xml
        repo syncCopy to clipboard
2. 将 QIMP SDK 层克隆到工作区：

        git clone https://github.com/quic-yocto/meta-qcom-qim-product-sdk -b <qim-product-sdk release tag> layers/meta-qcom-qim-product-sdk
        # Example, <qim-product-sdk release tag> is qcom-6.6.28-QLI.1.1-Ver.1.1_qim-product-sdk-1.1.3Copy to clipboard

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

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

        MACHINE=qcm6490 DISTRO=qcom-wayland source setup-environment
        # source setup-environment: Sets the environment settings, creates the build directory build-qcom-wayland,
        # and enters into build-qcom-wayland directory.Copy to clipboard
4. 编译软件镜像：

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

编译成功后，可以检查 `system.img` 是否位于 `<workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcm6490/qcom-multimedia-image` 目录中：

        cd <workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcm6490/qcom-multimedia-image
        ls -al system.imgCopy to clipboard

### 编译 QIRP SDK 镜像

1. 下载 Qualcomm Yocto 和支持层：
Note: QIRP SDK 版本的 `<manifest release tag>` 与基础版本相同。必须在基础版本之上克隆 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.28-QLI.1.1-Ver.1.1.xml
        repo syncCopy to clipboard

Note: 有关最新的 `<manifest release tag>`，参见[发行说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-240626095531/)中的<cite class="cite">编译关键发布标签</cite>部分。
2. 将 QIRP SDK 层下载到基础版本 `<WORKSPACE DIR>` 目录中：

        git clone https://git.codelinaro.org/clo/le/meta-ros.git -b ros.qclinux.1.0.r1-rel 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-sdkCopy 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=qcm6490 DISTRO=qcom-robotics-ros2-humble source setup-robotics-environment
        # source setup-robotics-environment: Sets the environment settings, creates the build directory build-qcom-robotics-ros2-humble,
        # and enters into build-qcom-robotics-ros2-humble directory.Copy to clipboard
4. 编译 robotics 镜像和 QIRP SDK 文件：

        ../qirp-build qcom-robotics-full-imageCopy to clipboard

编译成功后，可以在以下路径看到 QIRP SDK 编译文件：

        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/qcm6490/qcom-robotics-full-imageCopy to clipboard

### 编译实时 Linux 镜像

1. 下载 Qualcomm Yocto 和支持层：
Note: 实时 Linux 镜像的 `<manifest release tag>` 与基础版本相同。必须在基础版本之上克隆实时 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.28-QLI.1.1-Ver.1.1.xml
        repo syncCopy to clipboard

Note: 有关最新的 `<manifest release tag>`，参见[发行说明](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-240626095531/)中的<cite class="cite">编译关键发布标签</cite>部分。
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.28-QLI.1.1-Ver.1.1_realtime-linux-1.0Copy to clipboard

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

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

        MACHINE=qcm6490 DISTRO=qcom-wayland source setup-environment
        # source setup-environment: Sets the environment settings, creates the build directory build-qcom-wayland,
        # and enters into build-qcom-wayland directoryCopy to clipboard
4. 编译软件镜像：

        bitbake qcom-multimedia-imageCopy to clipboard

编译成功后，可以检查 `system.img` 是否位于 `<workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcm6490/qcom-multimedia-image` 目录中：

        cd <workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcm6490/qcom-multimedia-image
        ls -al system.imgCopy to clipboard

### 刷写

按[非注册用户刷写镜像](https://docs.qualcomm.com/doc/80-70014-254Y/topic/flash_images_unregistered.html)章节所述，将软件镜像刷入设备。

Last Published: Oct 09, 2024

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