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

# 修改分区布局

本文介绍如何添加、删除、修改或重命名分区。有关分区概念和 Ptool 工作流程，请参阅[在 Qualcomm Linux 中管理分区](./manage-partitions-in-qualcomm-linux)。

定义 UFS 和 eMMC 设备分区的配置文件位于：

* [https://github.com/qualcomm-linux/qcom-ptool/blob/main/platforms/qcs6490-rb3gen2/ufs/partitions.conf](https://github.com/qualcomm-linux/qcom-ptool/blob/main/platforms/qcs6490-rb3gen2/ufs/partitions.conf)（适用于 UFS）
* [https://github.com/qualcomm-linux/qcom-ptool/blob/main/platforms/iq-615-evk/emmc/partitions.conf](https://github.com/qualcomm-linux/qcom-ptool/blob/main/platforms/iq-615-evk/emmc/partitions.conf)（适用于 eMMC）

要添加分区，请在此文件中添加一行条目。要移除分区，请删除相应的条目，从而将目标分区从待烧录镜像集合中移除。

许多分区对功能至关重要。要了解此文件在生成分区表中所起作用的详细信息，请参阅[在 Qualcomm Linux 中管理分区](./manage-partitions-in-qualcomm-linux#managing-partitions-in-qualcomm-linux)。

## **添加分区**

要在 `LUN0` 中添加名为 `test` 的分区，请在 `partitions.conf` 的 `LUN0` 部分之后添加以下行：

```text theme={null}
--partition --lun=0 --name=test --size=4096KB --type-guid=1B81F7E6-F50D-419B-A739-2AEFF8DA3335
```

这会向 `LUN0` 添加一个 4 MB 的 test 分区，GUID 由您自行确定。此分区不会烧录任何镜像，但在设备启动后可作为原始分区使用。由于此分区被添加到 `LUN0`，它会出现在以下任一位置：

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

**注意**

要使 `partitions.conf` 中的更改生效，请更新 `QCOM_PARTITION_CONF`。有关更多信息，请参阅[修改分区](./manage-partitions-in-qualcomm-linux#modify-partition)。

## **添加带二进制文件的分区**

1. 要在 `LUN0` 中添加名为 `test1` 的分区并将二进制文件烧录到所创建的分区，请在 `partitions.conf` 的 `LUN0` 部分之后添加以下行：
   ```text theme={null}
   --partition --lun=0 --name=test --size=4096KB --type-guid=1B81F7E6-F50D-419B-A739-2AEFF8DA3335 --filename=test1.bin
   ```
2. 将新的 `test1.bin` 二进制文件部署到 `build/tmp/deploy/images/rb3gen2-core-kit/$(image_name)`。

## **后续步骤**

* 要自定义内核，请参阅 [Qualcomm Linux 内核指南](https://dragonwingdocs.qualcomm.com/System/Kernel/modify-the-kernel)。
