# 新增自訂發行版設定

以下各小節將說明如何新增自訂的發行版設定並重建工作區。

## Qualcomm 定義的發行版組態概覽

Qualcomm Linux 的定義參考發行版本位於 `<workspace>/layers/meta-qcom-distro/conf/distro/qcom-wayland.conf`。若要檢查 DISTRO\_FEATURES 變數，請執行以下命令：

bitbake -e | grep ^DISTRO_FEATURES=
    Copy to clipboard

輸出：

DISTRO_FEATURES="acl alsa argp bluetooth debuginfod ext2 ipv4 ipv6 largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc  vfat seccomp pam overlayfs acl xattr selinux ptest security virtualization tpm wayland vulkan opengl systemd pulseaudio gobject-introspection-data ldconfig"
    Copy to clipboard

備註

[發行版功能](https://docs.yoctoproject.org/5.0.6/singleindex.html#distro-features) 描述輸出中顯示的 DISTRO\_FEATURES。

## 新增發行版配置

若要新增一個發行版設定檔，請執行以下操作：

1. 在 `<workspace>/layers/meta-qcom-distro/conf/distro` 中新增一個 `test-distro.conf` 檔案。
2. 使用與 `qcom-wayland.conf` 相同的內容，也就是執行 `cp qcom-wayland.conf test-distro.conf`。
3. 在 `test-distro.conf` 檔案中設置 `DISTRO_NAME = "Test Reference Distro with Wayland"`。
4. 在 `test-distro.conf` 檔案中設置 `DISTROOVERRIDES = "test-dist"`。
5. 設定環境並導出變數如下：

MACHINE="qcs6490-rb3gen2-core-kit" DISTRO="test-distro" source setup-environment
        Copy to clipboard

設定環境後，目前的工作空間目錄會變更為 `<workspace>/build-test-distro`。若要確認 `test-distro` 是否已生效，請開啟 `conf/auto.conf` 檔案並確認下列內容：

# This configuration file is dynamically generated every time
    # set_bb_env.sh is sourced to set up a workspace.  DO NOT EDIT.
    #--------------------------------------------------------------
    DISTRO ?= "test-distro"
    Copy to clipboard

若要驗證輸出結果，請執行以下命令：

bitbake -e | grep ^DISTROOVERRIDES=
    DISTROOVERRIDES="test-dist"
    Copy to clipboard

備註

如果你有權限使用 `meta-qcom-extras`，請在 `conf/bblayers.conf` 檔案中加入 `EXTRALAYERS ?=` `${WORKSPACE}/layers/meta-qcom-extras`。

若要重新建置映像檔，請執行以下命令：

bitbake qcom-multimedia-image
    Copy to clipboard

## 啟用或停用 DISTRO\_FEATURES

DISTRO\_FEATURES 提供一種機制，用來確認哪些套件必須納入產生的映像檔中。你可以透過 DISTRO\_FEATURES 變數選擇要啟用的功能，該變數會在發行版的 `test-distro.conf` 組態檔中設定或附加。更多資訊請參閱 [發行版功能](https://docs.yoctoproject.org/5.0.6/singleindex.html#distro-features)。

備註

選擇由社群定義的功能。

1. 開啟 `test-distro.conf` 檔案並新增以下內容：

DISTRO_FEATURES:append = " cramfs"
        Copy to clipboard
2. 測試更改是否已生效，然後重新建置：

bitbake -e | grep ^DISTRO_FEATURES=
        Copy to clipboard

    輸出如下：

DISTRO_FEATURES="acl alsa argp bluetooth debuginfod ext2 ipv4 ipv6 largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc  vfat seccomp pam overlayfs acl xattr selinux ptest security virtualization tpm usrmerge sota wayland vulkan opengl cramfs systemd pulseaudio gobject-introspection-data ldconfig"
        Copy to clipboard
3. 若要重新建置映像檔，請執行下列命令：

bitbake qcom-multimedia-image
        Copy to clipboard

Last Published: Dec 23, 2025

[Previous Topic
新增自訂機器設定](https://docs.qualcomm.com/bundle/publicresource/80-70020-27TC/topics/add_custom_machine_configurations.md) [Next Topic
新增映像配方](https://docs.qualcomm.com/bundle/publicresource/80-70020-27TC/topics/add_image_recipes.md)