> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 添加自定义发行版配置

以下内容说明如何添加自定义发行版配置并重新构建工作区。

为 Qualcomm Linux 定义的参考发行版位于 `<workspace>/layers/meta-qcom-distro/conf/distro/qcom-distro.conf`。要检查 `DISTRO_FEATURES` 变量，请运行以下命令：

```text theme={null}
bitbake -e | grep ^DISTRO_FEATURES=
```

输出：

```text theme={null}
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"
```

[发行版特性](https://docs.yoctoproject.org/5.0.14/singleindex.html#distro-features)描述了输出中显示的 `DISTRO_FEATURES`。

## **添加发行版配置**

要添加发行版配置文件，请执行以下操作：

1. 在 `<workspace>/layers/meta-qcom-distro/conf/distro` 中添加 `test-distro.conf` 文件。
2. 使用与 `qcom-distro.conf` 相同的内容，即 `cp qcom-distro.conf test-distro.conf`。
3. 在 `test-distro.conf` 文件中设置 `DISTRO_NAME = "Test reference distribution"`。
4. 在 `test-distro.conf` 文件中设置 `DISTROOVERRIDES = "test-dist"`。
5. 以 `meta-qcom/ci/qcom-distro.yml` 为参考，创建 `test-distro` 发行版文件。
6. 要初始化 kas 构建环境，请运行以下命令：
   ```text theme={null}
   kas shell meta-qcom/ci/rb3gen2-core-kit.yml:meta-qcom/ci/test-distro.yml
   ```

初始化 kas 构建环境后，要验证 `test-distro` 是否已生效并构建镜像，请按以下步骤操作：

1. 要验证所定义的 `test-distro` 是否已生效，请打开 `conf/local.conf` 文件确认以下内容：
   ```text theme={null}
   DISTRO ?= "test-distro"
   ```
2. 要验证输出，请运行以下命令：
   ```text theme={null}
   bitbake -e | grep ^DISTROOVERRIDES=
   DISTROOVERRIDES="test-dist"
   ```
   **注意**
   如果您有权访问 `meta-qcom-extras`，请将其添加到 `conf/bblayers.conf` 文件中的 `EXTRALAYERS ?=${WORKSPACE}/layers/meta-qcom-extras`。
3. 要重新构建镜像，请运行以下命令：
   ```text theme={null}
   bitbake qcom-multimedia-image
   ```

## **启用或禁用** `DISTRO_FEATURES`

`DISTRO_FEATURES` 提供了一种机制，用于验证生成的镜像中包含哪些软件包。您可以通过 `DISTRO_FEATURES` 变量选择要启用的特性，该变量在发行版的 `test-distro.conf` 配置文件中设置或追加。有关更多信息，请参阅[发行版特性](https://docs.yoctoproject.org/5.0.14/singleindex.html#distro-features)。

**注意**

请选择由社区定义的特性。

1. 打开 `test-distro.conf` 文件并添加以下行：
   ```text theme={null}
   DISTRO_FEATURES:append = " cramfs"
   ```
2. 测试更改是否已生效，然后重新构建：
   ```text theme={null}
   bitbake -e | grep ^DISTRO_FEATURES=
   ```
   输出如下：
   ```text theme={null}
   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"
   ```
3. 要重新构建，请运行以下命令：
   ```text theme={null}
   bitbake qcom-multimedia-image
   ```
