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

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

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

- Cấu hình

    - Máy x86
    - CPU lõi tứ, ví dụ, Intel i7-2600 ở tốc độ 3,4 GHz (tương đương hoặc mạnh hơn)
    - 300 GB dung lượng đĩa trống (phân vùng swap &gt; 32 GB)
    - 16 GB RAM
    - Ubuntu 22.04
- Công cụ

    - Git 1.8.3.1 trở lên
    - Tar 1.28 trở lên
    - Python 3.10.2 trở lên
    - GCC 8.0 trở lên
    - GNU Make 4.0 trở lên
- Quyền

    - Cần có quyền `sudo` để chạy một vài lệnh

Ghi chú

Quá trình biên dịch mã trên máy ảo diễn ra chậm và có thể mất vài giờ. Bạn nên dùng máy chủ Ubuntu để biên dị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 cho Qualcomm Linux](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-41/).

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

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-70020-254V/topic/github_workflow_unregistered_users.html#ubuntu-host-setup-github-unreg) để tải xuống kho lưu trữ git và các thuộc tính khác từ [tệp kê khai của Qualcomm](https://github.com/quic-yocto/qcom-manifest). Công cụ Repo tải xuống các tệp kê khai 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.90-QLI.1.5-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 dựng BSP + bản dựng Qualcomm IM SDK:<br><br><br>`qcom-6.6.90-QLI.1.5-Ver.1.1_qim-product-sdk-2.0.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> | Bản build BSP + bản build Real-time kernel:<br><br><br>`qcom-6.6.90-QLI.1.5-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 QIR SDK:<br><br><br>`qcom-6.6.90-QLI.1.5-Ver.1.1_robotics-product-sdk-1.1.xml` | `qcom-robotics-ros2-humble` |

Cú pháp thẻ phát hành như sau:

- Thẻ phát hành của tệp kê khai:

    `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.90-QLI.1.5-Ver.1.1.xml` cho biết những thông tin sau:

    - 6.6.90: Nhân Qualcomm Linux
    - QLI.1.5: Qualcomm Linux v1.5
    - 1.1: Bản phát hành theo cột mốc
- Thẻ phát hành của tệp kê khai dành cho bản sản phẩm hóa bổ sung:

    `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.90-QLI.1.5-Ver.1.1_qim-product-sdk-2.0.1.xml` cho biết những thông tin sau:

    - 6.6.90: Nhân Qualcomm Linux
    - QLI.1.5: Qualcomm Linux v1.5
    - qim-product-sdk-2.0.1: Bản phát hành Qualcomm IM SDK dựa trên QLI.1.5

        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.1: Bản phát hành theo cột mốc
    - 2.0.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ề các lớp Yocto, hãy xem [Các lớp siêu dữ liệu của Qualcomm Linux](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-27/qualcomm_bsp_metadata_layers.html).

### Dựng ảnh BSP

Bản dựng ả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 áp dụng cho Qualcomm SoC. Bản dựng này bao gồm cấu hình bản phân phối tham chiếu cho Qualcomm development kit. Để biết thêm chi tiết, hãy xem [Các lớp siêu dữ liệu của Qualcomm Linux](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-27/qualcomm_bsp_metadata_layers.html).

1. Tải xuống Qualcomm Yocto và các lớp hỗ trợ. Để biết thẻ `<manifest release tag>` mới nhất, hãy xem phần *Thẻ phát hành quan trọng trong bản dựng* trong [Ghi chú phát hành](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250630224842/).

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

    Để biết các cách kết hợp `<machine>` và `<override>`, hãy xem [Ghi chú phát hành](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250630224842/).
3. Dựng ảnh phần mềm. Để 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-70020-254V/topic/how_to.html#image-recipes-github-workflow).

bitbake <image recipe>
        # Example, bitbake qcom-multimedia-image
        Copy to clipboard
4. 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

### Dựng ảnh Qualcomm IM SDK

Qualcomm® Intelligent Multimedia SDK (IM SDK) là một tập hợp gồm 4 SDK chức năng độc lập: Qualcomm 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 chiếu mà bạn có thể dùng để phát triển các use case. Để biết thêm chi tiết, hãy xem [Hướng dẫn bắt đầu nhanh với Qualcomm IM SDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-51).

1. Tải xuống Qualcomm Yocto và các lớp hỗ trợ. `<manifest release tag>` cho bản dựng Qualcomm IM SDK giống với bản dựng BSP. Sao chép lớp Qualcomm IM SDK dựa trên bản dựng BSP. Để biết thẻ `<manifest release tag>` mới nhất, hãy xem phần *Thẻ phát hành quan trọng trong bản dựng* trong [Ghi chú phát hành](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250630224842/).

# 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.90-QLI.1.5-Ver.1.1.xml
        repo sync
        Copy to clipboard
2. Sao chép lớp Qualcomm IM 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.90-QLI.1.5-Ver.1.1_qim-product-sdk-2.0.1
        Copy to clipboard
3. Xuất lớp Qualcomm IM SDK:

export EXTRALAYERS="meta-qcom-qim-product-sdk"
        Copy to clipboard
4. 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

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

bitbake qcom-multimedia-image
        # Build SDK image
        bitbake qcom-qim-product-sdk
        Copy to clipboard
6. 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 QIR SDK

Qualcomm® Intelligent Robotics (QIR) 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 QIR SDK 2.0](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-265).

1. Tải xuống Qualcomm Yocto và các lớp hỗ trợ. `<manifest release tag>` cho bản dựng QIR SDK giống với bản dựng BSP. Sao chép lớp QIR SDK dựa trên bản dựng BSP. Để biết thẻ `<manifest release tag>` mới nhất, hãy xem phần *Thẻ phát hành quan trọng trong bản dựng* trong [Ghi chú phát hành](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250630224842/).

# 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.90-QLI.1.5-Ver.1.1.xml
        repo sync
        Copy to clipboard
2. Tải xuống các lớp QIR 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.90-QLI.1.5-Ver.1.1_robotics-product-sdk-1.1 layers/meta-qcom-robotics
        git clone https://github.com/quic-yocto/meta-qcom-robotics-distro.git -b qcom-6.6.90-QLI.1.5-Ver.1.1_robotics-product-sdk-1.1 layers/meta-qcom-robotics-distro
        git clone https://github.com/quic-yocto/meta-qcom-robotics-sdk.git -b qcom-6.6.90-QLI.1.5-Ver.1.1_robotics-product-sdk-1.1 layers/meta-qcom-robotics-sdk
        git clone https://github.com/quic-yocto/meta-qcom-qim-product-sdk -b qcom-6.6.90-QLI.1.5-Ver.1.1_qim-product-sdk-2.0.1 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

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

../qirp-build qcom-robotics-full-image
        Copy to clipboard
5. 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 QIR có nằm ở các đường dẫn sau không:

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

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

Lớp thời gian thực cung cấp các công thức và cấu hình cần thiết để chạy nhân Qualcomm Linux như một nhân thời gian thực. Nhân thời gian thực chạy với khả năng tạm dừng tiến trình được bật hoàn toàn thông qua cấu hình `CONFIG_PREEMPT_RT=y`. Lớp này hỗ trợ công thức `linux-kernel-qcom-rt` để tìm nạp và dựng nhân Qualcomm Linux cho máy được hỗ trợ. Lớp này thêm vào nhân và các bản vá `PREEMPT_RT` từ nguồn chính (upstream) dựa trên phiên bản nhân và cho phép cấu hình thời gian thực. Để biết thêm chi tiết, hãy xem [Kernel thời gian thực](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-3/real_time_kernel_overview.html).

1. Tải xuống Qualcomm Yocto và các lớp hỗ trợ. `<manifest release tag>` cho ảnh Linux thời gian thực giống với bản dựng BSP. Sao chép Linux thời gian thực dựa trên bản dựng BSP. Để biết thẻ `<manifest release tag>` mới nhất, hãy xem phần *Thẻ phát hành quan trọng trong bản dựng* trong [Ghi chú phát hành](https://docs.qualcomm.com/bundle/publicresource/topics/RNO-250630224842/).

# 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.90-QLI.1.5-Ver.1.1.xml
        repo sync
        Copy to clipboard
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.90-QLI.1.5-Ver.1.1_realtime-linux-1.1
        Copy to clipboard
3. Biên dịch lớp real-time:

export EXTRALAYERS="meta-qcom-realtime"
        Copy to clipboard
4. 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

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

bitbake qcom-multimedia-image
        Copy to clipboard
6. 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-70020-254V/topic/flash_images.html#flash-images).

## Chủ đề liên quan

- [Kết nối với shell UART](https://docs.qualcomm.com/doc/80-70020-254V/topic/how_to.html#connect-uart)
- [Kết nối với mạng](https://docs.qualcomm.com/doc/80-70020-254V/topic/how_to.html#connect-to-network)
- [Đăng nhập bằng SSH](https://docs.qualcomm.com/doc/80-70020-254V/topic/how_to.html#use-ssh)
- [Khắc phục sự cố về đồng bộ hóa, dựng và flash](https://docs.qualcomm.com/doc/80-70020-254V/topic/troubleshoot_sync_build_and_flash.html#troubleshoot-sync-build-and-flash)

Last Published: Dec 23, 2025

[Previous Topic
Biên dịch với QSC CLI](https://docs.qualcomm.com/bundle/publicresource/80-70020-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-70020-254V/topics/build_from_source_github_intro.md)