动态分区简介
Google dynamic partition definition
Dynamic partitions are a userspace partitioning system for Android. Using this partitioning system, you can create, resize, or destroy partitions during over-the-air (OTA) updates. With dynamic partitions, vendors no longer have to worry about the individual sizes of partitions such as system
, vendor
, and product
. Instead, the device allocates a super
partition, and sub-partitions can be sized dynamically within it. Individual partition images no longer have to leave empty space for future OTAs. Instead, the remaining free space in super
is available for all dynamic partitions.
简单的说就是,A10之前的Android的各个分区大小是固定的. 例如, QFIL后, system.img分区~1GB大小,vendor.img分区~800MB大小...大小是固定的.
但是有了动态分区之后,system/vendor的分区大小前后是可以变化的. 因为Android10开始实现了一个super分区,super分区中包含了system/vendor/...等等分区.这些子分区在未来的OTA操作中可以利用super分区剩余的空间进行动态调整.
这里的super分区就要分配的合理,例如分配一个8GB的super分区用于未来的几代的Android,这个8G要能够cover到后面系统升级的扩容可能.
Android dynamic partitions - postmarketOS Wiki // 从AndroidQ(A10)开始,Android推出了动态分区的概念.
动态分区优点
Android dynamic partitioning is a feature introduced to manage system storage more efficiently. It allows devices to use partitions that can change in size based on the needs of the operating system and apps, rather than being fixed.This flexibility supports improved storage utilization and easier updates, as partitions can be resized without requiring physical changes to the storage medium.
动态分区缺点
- 当某个分区的大小超过超级分区的一半时,编译系统可能会报错。
- 在进行 OTA 更新时,如果目标分区空间不足,更新可能会失败。
- 具有动态分区的设备不得使用 system-as-root。
- 在 Android 10 中,BOARD_BUILD_SYSTEM_ROOT_IMAGE 标记仅用于区分系统是由内核装载还是在第一阶段装载 init(在 ramdisk 中)。
动态分区未来
随着UFS的性能和容量变大,super分区应该一直使用下去.PC端也有类似的技术.