# Biên dịch với GitHub cho người dùng chưa đăng ký

Các phần sau giải thích cách dùng GitHub và tạo bản build bằng các tệp thực thi/ảnh phần mềm mã nguồn đóng được biên dịch sẵn.

Ghi chú

Để biết thêm chi tiết về SoC phần cứng được hỗ trợ trong phương pháp biên dịch này, hãy xem bảng *Phương pháp đồng bộ hóa và biên dịch* trong [Release notes](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250403001134/).

## Yêu cầu đối với máy chủ

| Cấu hình | Công cụ | Quyền |
| --- | --- | --- |
| Máy x86 | Git 1.8.3.1 trở lên | Cần có quyền `sudo` để chạy một vài lệnh |
| CPU lõi tứ, ví dụ: Intel i7-2600 ở tốc độ 3,4 GHz (tương đương hoặc mạnh hơn) | Tar 1.28 trở lên | Cần có quyền `sudo` để chạy một vài lệnh |
| 300 GB dung lượng đĩa trống (phân vùng swap &gt; 32 GB) | Python 3.10.2 trở lên | Cần có quyền `sudo` để chạy một vài lệnh |
| 16 GB RAM | GCC 8.0 trở lên | Cần có quyền `sudo` để chạy một vài lệnh |
| Ubuntu 22.04 | GNU Make 4.0 trở lên | Cần có quyền `sudo` để chạy một vài lệnh |
|  |  |  |
|  |  |  |
|  |  |  |
|  |  |  |

Ghi chú

Để thiết lập máy ảo (VM) chạy Ubuntu 22.04 trên Microsoft^®^ Windows^®^ hoặc Apple^®^ macOS^®^, hãy xem [Hướng dẫn thiết lập máy ảo Qualcomm Linux](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-41/). Quá trình biên dịch mã trên máy ảo diễn ra chậm và thường mất vài giờ. Bạn nên dùng máy chủ Ubuntu vật lý để biên dịch.

## Biên dịch bằng các lệnh độc lập

### Thiết lập máy chủ Ubuntu

Cài đặt và đặt cấu hình các công cụ phần mềm cần thiết trên máy chủ Ubuntu.

1. Cài đặt các gói sau để chuẩn bị môi trường cho biên dịch 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. Thiết lập ngôn ngữ (nếu chưa thiết lập):

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. Cập nhật cấu hình 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

### Đồng bộ hóa

Phần này dùng công cụ Repo được cài đặt trong phần [thiết lập máy chủ Ubuntu](https://docs.qualcomm.com/doc/80-70018-254V/topic/github_workflow_unregistered_users.html#ubuntu-host-setup-github-unreg) để tải xuống git repositories và các thành phần khác từ [Qualcomm manifest](https://github.com/quic-yocto/qcom-manifest). Công cụ Repo tải xuống các manifests  bằng lệnh `repo init`.

Bảng sau đây minh họa về ánh xạ lớp Yocto với phiên bản phát hành manifest. Hãy dùng bảng ánh xạ này để tải xuống và biên dịch Qualcomm Linux.

Ánh xạ lớp Yocto với phiên bản phát hành manifest

| Lớp Yocto | Phiên bản phát hành của manifest | Bản phân phối tham chiếu (`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> | Bản build BSP: Hệ điều hành cấp cao và firmware biên dịch sẵn (chỉ GPS)<br><br><br>`qcom-6.6.65-QLI.1.4-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> | Bản build BSP + bản build QIMP SDK:<br><br><br>`qcom-6.6.65-QLI.1.4-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> | Bản build BSP + bản build Real-time kernel:<br><br><br>`qcom-6.6.65-QLI.1.4-Ver.1.1_realtime-linux-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-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> | Bản build BSP + bản build QIRP SDK:<br><br><br>`qcom-6.6.65-QLI.1.4-Ver.1.0_robotics-product-sdk-1.0.xml` | `qcom-robotics-ros2-humble` |

Ghi chú

- Cú pháp cho phiên bản phát hành của manifest:

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

    Ví dụ: phiên bản phát hành của tệp manifest  `qcom-6.6.65-QLI.1.4-Ver.1.1.xml` cho biết những thông tin sau:

    - 6.6.65: Qualcomm Linux kernel
    - QLI.1.4: Qualcomm Linux v1.4
    - 1.0: Bản phát hành theo cột mốc
- Cú pháp đặt tên phiên bản phát hành manifest bổ sung cho quá trình sản phẩm hóa:

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

    Ví dụ: phiên bản phát hành của tệp manifest  dành cho bản sản phẩm hóa bổ sung `qcom-6.6.65-QLI.1.4-Ver.1.1_qim-product-sdk-1.1.2.xml` cho biết những thông tin sau:

    - 6.6.65: Qualcomm Linux kernel
    - QLI.1.4: Qualcomm Linux v1.4
    - qim-product-sdk-1.1.1: Bản phát hành QIMP SDK dựa trên QLI.1.4

        Các ví dụ khác về sản phẩm/tùy chỉnh:

        - *realtime-linux-1.0*
        - *robotics-product-sdk-1.1*
    - 1.0: Bản phát hành theo cột mốc
    - 1.1.1: Bản phát hành bản vá liên quan đến bản phát hành theo cột mốc
- Để biết thêm thông tin về lớp Yocto, hãy xem [Qualcomm Linux metadata layers](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-27/qualcomm_linux_metadata_layers_overview.html#qualcomm-linux-metadata-layers).

### Biên dịch ảnh BSP

Bản build ảnh Gói hỗ trợ bo mạch (BSP) có các thành phần phần mềm hỗ trợ thiết bị Qualcomm và các tính năng phần mềm mở rộng áp dụng cho Qualcomm SoC. Nó  bao gồm cấu hình bản phân phối tham khảo cho Qualcomm development kits.

Để biết thêm chi tiết, hãy xem [Qualcomm Linux metadata layers](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-27/qualcomm_linux_metadata_layers_overview.html#qualcomm-linux-metadata-layers).

1. Tải xuống Qualcomm Yocto và các lớp hỗ trợ:

# 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.65-QLI.1.4-Ver.1.1.xml
        repo sync
        Copy to clipboard

Ghi chú

Để biết phiên bản `<manifest release tag>` mới nhất, hãy xem phần *Phiên bản phát hành quan trọng* trong [Release Notes](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250403001134/).
2. Thiết lập môi trường biên dịch:

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

Ghi chú

Để biết các cách kết hợp `<machine>` và `<override>`, hãy xem [Release Notes](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250403001134/).
3. Biên dịch ảnh phần mềm:

Ghi chú

Để biết các Yocto recipes cho  ảnh phần mềm được hỗ trợ, hãy xem [Các recipes cho ảnh được hỗ trợ trong quy trình làm việc trên GitHub](https://docs.qualcomm.com/doc/80-70018-254V/topic/how_to.html#image-recipes-github-workflow).

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

    Sau khi  biên dịch thành công, hãy kiểm tra xem tệp `system.img` có nằm trong thư mục `<workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-multimedia-image` hay không:

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

### Biên dịch ảnh QIMP SDK

Qualcomm® Intelligent Multimedia Product (QIMP) SDK là tập hợp gồm 4 SDK chức năng độc lập, gồm Qualcomm® Intelligent Multimedia SDK (IM SDK), Qualcomm® Neural Processing SDK, Qualcomm® AI Engine Direct SDK và Lite Runtime (LiteRT). SDK này cũng bao gồm các ứng dụng tham khảo mà bạn có thể dùng để phát triển các ứng dụng cụ thể.

Để biết thêm chi tiết, hãy xem [Hướng dẫn bắt đầu nhanh về QIMP SDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-51).

1. Tải xuống Qualcomm Yocto và các lớp hỗ trợ:

Ghi chú

    - `<manifest release tag>` cho bản build QIMP SDK giống với bản build BSP. Sao chép lớp QIMP SDK lên trên bản build BSP.
    - Để biết phiên bản `<manifest release tag>` mới nhất, hãy xem phần *Phiên bản phát hành quan trọng* trong [Release Notes](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250403001134/).

# 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.65-QLI.1.4-Ver.1.1.xml
        repo sync
        Copy to clipboard
2. Sao chép lớp QIMP SDK vào không gian làm việc:

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.65-QLI.1.4-Ver.1.1_qim-product-sdk-1.1.2
        Copy to clipboard

    Biên dịch lớp QIMP SDK:

export EXTRALAYERS="meta-qcom-qim-product-sdk"
        Copy to clipboard
3. Thiết lập môi trường biên dịch:

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

Ghi chú

Để biết các giá trị tham số `MACHINE`, hãy xem [Release Notes](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250403001134/).
4. Biên dịch ảnh phần mềm:

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

    Sau khi  biên dịch thành công, hãy kiểm tra xem tệp `system.img` có nằm trong thư mục `<workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-multimedia-image` hay không:

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

### Biên dịch ảnh QIRP SDK

QIRP® Intelligent Robotics Product (QIRP) SDK 2.0 là một tập hợp các thành phần cho phép bạn phát triển tính năng robot trên nền tảng Qualcomm.    SDK này áp dụng cho các bản phát hành Qualcomm Linux.

Để biết thêm chi tiết, hãy xem [Hướng dẫn sử dụng QIRP SDK 2.0](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-265).

1. Tải xuống Qualcomm Yocto và các lớp hỗ trợ:

Ghi chú

`<manifest release tag>` cho bản build QIRP SDK giống với bản build BSP. Sao chép lớp QIRP SDK lên trên bản build BSP.

# 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.65-QLI.1.4-Ver.1.1.xml
        repo sync
        Copy to clipboard

Ghi chú

Để biết phiên bản `<manifest release tag>` mới nhất, hãy xem phần *Phiên bản phát hành quan trọng* trong [Release Notes](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250403001134/).
2. Tải xuống các lớp QIRP SDK vào thư mục `<WORKSPACE DIR>` của bản build BSP:

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.65-QLI.1.4-Ver.1.0_robotics-product-sdk-1.0 layers/meta-qcom-robotics
        git clone https://github.com/quic-yocto/meta-qcom-robotics-distro.git -b qcom-6.6.65-QLI.1.4-Ver.1.0_robotics-product-sdk-1.0 layers/meta-qcom-robotics-distro
        git clone https://github.com/quic-yocto/meta-qcom-robotics-sdk.git -b qcom-6.6.65-QLI.1.4-Ver.1.0_robotics-product-sdk-1.0 layers/meta-qcom-robotics-sdk
        git clone https://github.com/quic-yocto/meta-qcom-qim-product-sdk -b qcom-6.6.65-QLI.1.4-Ver.1.1_qim-product-sdk-1.1.2 layers/meta-qcom-qim-product-sdk
        Copy to clipboard
3. Thiết lập môi trường biên dịch:

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

Ghi chú

Để biết các cách kết hợp `<machine>` và `<override>`, hãy xem [Release Notes](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250403001134/).
4. Biên dịch ảnh phần mềm cho robot và các cấu phần phần mềm QIRP SDK:

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

    Sau khi  biên dịch thành công, hãy kiểm tra xem các cấu phần phần mềm của bản build SDK QIRP có nằm ở các đường dẫn sau không:

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

### Biên dịch ảnh real-time Linux

Lớp real-time cung cấp các recipes  và cấu hình cần thiết để chạy Qualcomm Linux kernel như một real-time kernel. Real-time kernel chạy với  preemption thông qua cấu hình `CONFIG_PREEMPT_RT=y`. Lớp này thêm vào `linux-kernel-qcom-rt` recipe để tải và biên dịch Qualcomm Linux kernel cho máy mục tiêu được hỗ trợ. Đồng thời thêm vào kernel các bản patches `PREEMPT_RT` từ upstream ứng với phiên bản kernel và cho phép cấu hình real-time.

Để biết thêm chi tiết, hãy xem [Real-time kernel](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-3/real_time_kernel_overview.html).

1. Tải xuống Qualcomm Yocto và các lớp hỗ trợ:

Ghi chú

`<manifest release tag>` cho ảnh real-time Linux  giống với bản build BSP. Sao chép real-time Linux lên trên bản build BSP.

# 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.65-QLI.1.4-Ver.1.1.xml
        repo sync
        Copy to clipboard

Ghi chú

Để biết phiên bản `<manifest release tag>` mới nhất, hãy xem phần *Phiên bản phát hành quan trọng* trong [Release Notes](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250403001134/).
2. Sao chép lớp Real-time kernel vào không gian làm việc:

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.65-QLI.1.4-Ver.1.1_realtime-linux-1.1
        Copy to clipboard

    Biên dịch lớp real-time:

export EXTRALAYERS="meta-qcom-realtime"
        Copy to clipboard
3. Thiết lập môi trường biên dịch:

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

Ghi chú

Để biết các cách kết hợp `<machine>` và `<override>`, hãy xem [Release Notes](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250403001134/).
4. Biên dịch ảnh phần mềm:

bitbake qcom-multimedia-image
        Copy to clipboard

    Sau khi  biên dịch thành công, hãy kiểm tra xem tệp `system.img` có nằm trong thư mục `<workspace_path>/build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-multimedia-image` hay không:

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

### Flash

Để flash ảnh phần mềm vào thiết bị, hãy xem [Flash ảnh phần mềm](https://docs.qualcomm.com/doc/80-70018-254V/topic/flash_images.html#flash-images).

Last Published: Oct 23, 2025

[Previous Topic
Biên dịch với QSC CLI](https://docs.qualcomm.com/bundle/publicresource/80-70018-254V/topics/build_frm_source_qsc_cli.md) [Next Topic
Biên dịch với GitHub cho người dùng đã đăng ký](https://docs.qualcomm.com/bundle/publicresource/80-70018-254V/topics/build_from_source_github_intro.md)

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