fix: keep KPM install and unload state consistent - #1562
Open
matsuzaka-yuki wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In the KPM management flow, uninstall state was inconsistent: installing a module then immediately unloading it left the UI in a stale state, and the persistent file under
/data/adb/ap/kpm/<id>/could remain after the module appeared removed.This change decouples the install/unload decisions so the UI reflects what actually happened on disk and in the kernel.
Changes
KPModuleViewModel.ktNatives.kernelPatchModuleList()when the kernel actually reports a nonzero module count.Natives.kernelPatchModuleInfo(id)for modules that are not in the loaded kernel list; freshly installed (not yet rebooted) modules no longer trigger a live kernel lookup.KPM.ktrm -rf ... && test ! -e ...).Why
KPM installed via the "Install" action is only loaded by the boot-time loader after reboot. Re-querying the kernel for it immediately after install (and the combined uninstall condition) made the UI show the module as present/removed incorrectly, and could leave a stale
/data/adb/ap/kpm/<id>/<id>.kpmentry after uninstall.