Repository navigation
Fixes a 1 GB storage leak and a soft-reboot crash caused by deleting staging while it was still mounted.
Fixes:
- Staging leak (1 GB per install). Staged vendor directories were written as siblings of
.staging/(.staging_vendor_lib64) instead of inside it, so every cleanup path missed them. Each apply leaked a full copy of/vendor/lib64— 1.0 GB — into/datapermanently. Staged dirs now live in.staging/dir_*, and all cleanup paths also sweep the legacy.staging_*form. Upgrading frees the leaked space on the next apply. - Staging cost cut ~25x. A payload lib with a new filename in
/vendor/lib64forces a merged copy of that whole directory. New names are now placed in/vendor/lib64/egl, which the linker's sphal namespace searches too (verified against/linkerconfig/ld.config.txt): staging drops from ~1 GB to ~43 MB with identical resolution. Files that replace a stock lib keep their exact path (per-file bind, no staging). - Crash-safe staging deletion. Deleting a staging dir that is still the live mount source for
/vendor/lib64empties the mounted directory; vendor HALs then SIGSEGV ondlopenand the system soft-reboots.gm_stage_cleannow refuses to delete while any of staging is mounted in init/zygote,driver-selectno longer deletes staging synchronously, and a newstage-cleansubcommand exposes the guarded cleanup manually.
Also:
- Reject saved plans from older versions (their staged dirs point at the leaked legacy paths) and rebuild automatically
doctorreports the staged directory size; the engine warns above 256 MB- Never
rm -rfthe module dir or.staging*while a driver is active — usedriver-clear,action.sh unmount, or reboot first (mounts are in-memory, so a reboot always detaches them)
Verified on-device (Galaxy S23, SM-S911U1, Adreno 740): module size 1.0 GB → 120 MB, staging 43 MB, driver served in init/zygote/surfaceflinger namespaces, VulkanCapsViewer enumerates the custom driver, no restarts over repeated observation windows. Test suites: 40 + 20 + 74 assertions pass.