# 修改分区布局

此处介绍了如何添加、删除、修改或重命名分区。

定义 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-70022-27SC/topic/managing_partitions_in_qualcomm_linux.html#managing-partitions-in-qualcomm-linux)。

## 添加分区

要在 `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-70022-27SC/topic/managing_partitions_in_qualcomm_linux.html#modify-partition)。

## 添加包含二进制文件的分区

1. 要将包含待刷写二进制文件的分区添加到 `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
2. 在 `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-70022-3/)。

Last Published: Nov 04, 2025

[Previous Topic
定制镜像特性](https://docs.qualcomm.com/bundle/publicresource/80-70022-27SC/topics/customizing_image_features.md) [Next Topic
使用 devtool 修改 Qualcomm 设备加载程序](https://docs.qualcomm.com/bundle/publicresource/80-70022-27SC/topics/modify_qdl_source_using_devtool.md)