Skip to content

twrpinstall: prepare dynamic partitions before flashing - #23

Open
sorrow404Null wants to merge 2 commits into
TWRP-Test:twrp-16.0from
sorrow404Null:fix-dynamic-partition-install
Open

sorrow404Null wants to merge 2 commits into
TWRP-Test:twrp-16.0from
sorrow404Null:fix-dynamic-partition-install

Conversation

@sorrow404Null

@sorrow404Null sorrow404Null commented Aug 31, 2026

Copy link
Copy Markdown

Summary

  • recognize both unsuffixed and slot-suffixed dynamic partition operation lists
  • discover logical-partition holders from TWRP's registered super devices and each running init service's process mappings and file descriptors
  • stop only services that actually reference a logical partition, unmap through TWPartitionManager, then restore their previous running state
  • avoid device-specific service names, mount points, partition names, and boot properties

Testing

  • source setup-env.sh && export TARGET_HW_DISK_ENCRYPTION=false TARGET_HW_DISK_ENCRYPTION_PERF=false && m SOONG_CONFIG_TYPE_twrpGlobalVars_supports_hw_fde=bool SOONG_CONFIG_TYPE_twrpGlobalVars_supports_hw_fde_perf=bool -j12 libtwrpinstall
  • Xiaomi 15 (dada): the original failure reproduced as DM_DEV_REMOVE/EBUSY; dynamic-partition teardown allowed the full-device package to complete with updater RC=0 while affected recovery services were restored after unmapping

Stop recovery services that keep logical vendor and odm partitions open before removing their dm mappings, then restore services that were running before teardown. Recognize slot-suffixed dynamic partition operation lists used by full-device packages.

Test: source setup-env.sh && export TARGET_HW_DISK_ENCRYPTION=false TARGET_HW_DISK_ENCRYPTION_PERF=false && m SOONG_CONFIG_TYPE_twrpGlobalVars_supports_hw_fde=bool SOONG_CONFIG_TYPE_twrpGlobalVars_supports_hw_fde_perf=bool -j12 libtwrpinstall

This comment was marked as outdated.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants