Skip to content

Storage Layout & super Dynamic Partition Orchestration ​

Before modifying any boot image on an ARM64 A/B device, map out how physical boot partitions and super logical partitions fit together. Good storage planning guarantees fast rollback and protects device calibration partitions.

1. Physical Boot Partitions vs super Dynamic Partitions ​

Modern Android GKI 6.x A/B devices split storage into two tiers:

  • Physical A/B Boot Partitions:
    • boot_{a,b}: Linux GKI kernel Image.
    • init_boot_{a,b}: Generic first-stage ramdisk and PID1 /init.
    • vendor_boot_{a,b}: Vendor ramdisk, early .ko kernel modules, bootconfig, and early fstab.
    • dtbo_{a,b}: Board DeviceTree overlay table.
    • recovery_{a,b} (optional): Dedicated recovery partition on devices that do not pack recovery inside vendor_boot.
    • vbmeta*, misc (Bootloader Control Block / scratch space), and userdata (/data).
  • super Dynamic Partition (AOSP liblp / Linux dm-linear):
    • A single large physical partition (commonly 8-16 GiB) divided by LP metadata headers into logical partitions (system, vendor, product, odm, system_ext, *_dlkm), mapped at boot via kernel device-mapper (dm-linear) under /dev/block/mapper/<name>.

2. Inspecting Stock super Geometry & Slot Planning ​

Always inspect the stock super layout first using standard open-source AOSP partition tools (lpdump, lpunpack, lpmake):

bash
lpdump super.img   # Inspect total super size, alignment, and slot_a / slot_b group limits

Choose the slot strategy that fits your device's free capacity:

  1. Dual-Slot Safe Rollback Layout (Recommended during early bring-up):
    • Keep all stock slot_a logical partitions (*_a) completely untouched inside super so fastboot set_active a restores the stock OS immediately.
    • Compose the OpenHarmony logical partitions inside slot_b (*_b) within the remaining super capacity.
  2. Full-Capacity Single-Target Layout:
    • When the target OpenHarmony rootfs and vendor partitions exceed half of super, back up the full stock super.img offline first, then resize LP group limits cleanly with lpmake.
  3. External Loop-Mounted Auxiliary Images:
    • Large optional runtime images (such as an AnCo compatibility container rootfs) do not need to occupy super; keep them as read-only .erofs files under /data and attach them via loop devices on demand.

3. Logical Partition Composition Inside super ​

Both Approach A (pure open-source OpenHarmony build) and Approach B (local user-owned BYOF synthesis) follow the same logical partition structure:

Logical Partition (Target Slot)Base SourceComposition & Required Adjustments
system (system_b)OpenHarmony / target system rootfs (Approach A open-source build, or Approach B local user-owned system image; not stock Android system)Serves as the post-switch_root root and /system. Overlay cross-silicon UniOHOS/core runtime components (sidecar-runtime, hybris-bridge, device-parts) and incremental .cil SELinux deltas, then repack as read-only EROFS (optionally 64KB-aligned for hot libraries).
vendor (vendor_b)Target device stock vendor (or open-source OpenHarmony vendor in pure Approach A)Under Approach B, keep stock device vendor firmware, HAL libraries, and hardware configs read-only (mounted in the isolated Bionic Sidecar namespace and accessed by the GPU bridge), while injecting/binding SoC hardware adapters (composer_vdi, buffer_vdi, audio/camera/RIL/power VDIs) and OpenHarmony init configs. Repack as read-only EROFS.
sys_prod (sys_prod_b)OpenHarmony system product configuration layerStrip conflicting reference-device triggers or policies and tune system parameters (resolution, DPI, display, power, and peripheral properties) for the target device.
chip_prod (chip_prod_b)SoC & board product layer (UniOHOS-Devices/<vendor>-<soc>-bsp/common/ + profiles/<vendor>/<codename>/)Holds silicon HDF/HDI configs, audio mixer topology, charging/thermal configs, and board-level panel/sensor/modem profiles, keeping system device-independent.
odm (odm_b)Target device stock odm (conditional)Retain read-only if stock odm carries device-specific firmware, camera calibration, speaker amp configs, or NFC/sensor assets (either as a logical partition or mounted for Sidecar access); otherwise trim or omit.
product / system_extTarget device stock Android overlaysNot used by OpenHarmony userland. In the target slot (e.g., _b), shrink to zero or drop from the _b LP group to free super space (keep *_a intact if preserving dual-slot rollback).
vendor_dlkm / odm_dlkm / system_dlkmTarget device stock GKI kernel-module partitionsGKI devices store loadable .ko kernel drivers (Wi-Fi, charging, audio, peripherals) in these logical partitions. Keep read-only (or merge required .ko files into vendor_boot / vendor) so hardware drivers load cleanly on boot.

4. Physical Partitions Outside super ​

Physical PartitionModification Needed?Required Adjustments & Safety Notes
boot_{a,b}Yes (target slot)Flash the GKI ABI-aligned custom Linux kernel Image (enabling needed EROFS algorithms, HMFS ioctl compatibility, SELinux options, and device patches). Run UniOHOS/gki-sdk offline gates before flashing.
init_boot_{a,b}Yes (mandatory on target slot)Replace stock Android first-stage ramdisk with OpenHarmony / UniOHOS/core/early-bringup first-stage PID1: initializes misc logging and ConfigFS USB ACM, parses super LP metadata to instantiate dm-linear devices, loads early .ko closures, fixes /dev mode (0755), mounts /usr, and executes switch_root /usr /bin/init --second-stage.
vendor_boot_{a,b}Yes (repack from stock base)Unpack the target device's stock vendor_boot as baseline: preserve essential early stock .ko drivers and firmware, add any custom out-of-tree .ko modules (verified with gki-kcfi-ko-gate), update first-stage fstab / fstab.required to match the new super layout (keeping modem/calibration partitions ro,norecovery), and adjust bootconfig / kernel cmdline as needed.
recovery_{a,b} (optional)OptionalDedicated physical recovery partition. Optionally deploy UniOHOS/recovery paired with per-SoC recovery-platform/ supporting HDC Sideload and Fastbootd; verify no OEM trigger wipes system or userdata.
dtbo_{a,b}Optional / as neededRebuild board DeviceTree overlays from pure-text .dts sources when tuning panel timing, DP Alt-Mode, touch, USB peripheral role, charging nodes, or peripherals; stock dtbo may be reused initially if nodes already match.
vbmeta*Yes (verification flags)On an unlocked bootloader with modified boot/init_boot/vendor_boot/super, flash vbmeta with --disable-verity --disable-verification (or re-sign with your own AVB keys).
userdata (/data)Backup & initialize as neededKeep native F2FS. Back up personal data before first boot into OpenHarmony; initialize /data if needed, or ensure clean directory separation and SELinux xattr labeling.
miscOptional offset use onlyPreserve the standard BCB region; during Stage 0 bring-up, early logging may write checkpoints to a reserved offset (such as misc+0x1000).
persist, modem_*, nvram, nvdata, nvcfg, protect1, protect2Prerequisite: keep read-onlyCritical modem, EFS, and hardware calibration partitions. Keep completely untouched and mount strictly ro,norecovery in both fstab and Sidecar.
xloader_*, bl2_*, uefi_*, tee_*, GPT tableNo changes needed (keep stock recommended)Low-level bootloader chain and partition table. OpenHarmony porting does not require modifying these partitions; keeping them stock preserves fastboot recovery.

5. Filesystem Selection & 64KB Alignment ​

  • Read-Only Logical Partitions (system, vendor, sys_prod, chip_prod, odm): Use EROFS (LZ4 / LZ4HC / ZSTD). Verify the kernel enables CONFIG_EROFS_FS and matching compression algorithms before flashing. Hot shared libraries listed in tier0-preload.txt can be packed with 64KB alignment via UniOHOS/builder/fs-tools to leverage ARM64 MMU PTE_CONT TLB coalescing.
  • Writable /data Partition: Keep the device's native F2FS filesystem and add lightweight HMFS ioctl compatibility (0xf5xx) in the kernel patch stack instead of destructively reformatting to proprietary filesystems.

Next Step

Once your storage map is defined, proceed to the Device Porting Guide (Stage 0-4) to bring up PID1 logging, GKI ABI verification, display, Sidecar, and SELinux.

Independent Open-Source Community (CC-BY-4.0). Not affiliated with Huawei, HiSilicon, OpenAtom Foundation, Xiaomi, Qualcomm, MediaTek, or Arm.