# 修改分区布局

本节介绍如何添加、删除、修改或重命名分区。定义 UFS 和 eMMC 设备分区的配置文件位于：

- `layers/meta-qcom-hwe/recipes-devtools/partition-utils/qcom-partition-confs/ufs/qcm6490-partitions.conf`（用于 UFS）
- `layers/meta-qcom-hwe/recipes-devtools/partition-utils/qcom-partition-confs/emmc/qcm6490-partitions.conf`（用于 eMMC）

若要添加分区，请向此文件添加行条目。要删除分区，请删除相应的条目以从要刷写的镜像集中删除目标分区。

许多分区对于实现相关功能至关重要。要了解此文件在生成分区表的过程中具体如何起作用，请参阅[在 Qualcomm Linux 中管理分区](https://docs.qualcomm.com/doc/80-70020-27SC/topic/managing_partitions_in_qualcomm_linux.html#managing-partitions-in-qualcomm-linux)。

**示例 1：添加一个分区**

要在 LUN0 中添加名称为 `test` 的分区，请以下行添加到LUN0 部分下的 `qcm6490-partitions.conf`：

--partition --lun=0 --name=test --size=4096KB --type-guid=1B81F7E6-F50D-419B-A739-2AEFF8DA3335
    Copy to clipboard

这会向 LUN0 添加一个 4 MB 的分区测试和一个由您确定的 GUID。此分区未刷写任何镜像，但在设备启动后可用作原始分区。由于该分区已添加到 LUN0，因此会显示在以下任一选项的路径下：

- `/dev/sda<N>`
- `/dev/disk/by-partlabel/test`

Note

要反映 `qcm6490-partitions.conf` 中的更改，请更新首选提供程序。有关更多信息，请参阅[修改分区](https://docs.qualcomm.com/doc/80-70020-27SC/topic/managing_partitions_in_qualcomm_linux.html#modify-partition)。

**示例 2：添加一个分区，其中包含要刷写到新创建的分区的二进制文件**

要在 LUN0 中添加名称为 `test1` 的分区，请以下行添加到LUN0 部分下的 `qcm6490-partitions.conf`：

--partition --lun=0 --name=test --size=4096KB --type-guid=1B81F7E6-F50D-419B-A739-2AEFF8DA3335 --filename=test1.bin
    Copy to clipboard

在 `build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-rb3gen2-core-kit/$(image_name)` 中部署新的 `test1.bin` 二进制文件。

## 后续步骤

- 自定义内核

    要定制内核，请参阅 [Qualcomm Linux 内核指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-3/)。

Last Published: Jul 24, 2025

[Previous Topic
定制镜像特性](https://docs.qualcomm.com/bundle/publicresource/80-70020-27SC/topics/customizing_image_features.md) [Next Topic
devtool的使用](https://docs.qualcomm.com/bundle/publicresource/80-70020-27SC/topics/use_of_devtool.md)