-
-
Notifications
You must be signed in to change notification settings - Fork 3k
manager: install: add choose partition support #2896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
YuKongA
commented
Nov 9, 2025
- close direct install and install to inactive slot fails #2865
2577988 to
0ff79ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds partition selection functionality for boot patching, allowing users to manually choose which partition (init_boot, boot, or vendor_boot) to flash. It also introduces new CLI commands for querying boot information such as slot suffixes, available partitions, and device paths.
Key changes:
- Added partition override parameter to boot patch CLI and backend logic
- Implemented new boot-info subcommands for querying device information
- Enhanced UI with dropdown for partition selection in install screen
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| userspace/ksud/src/cli.rs | Added partition parameter to patch command and new boot-info subcommands (is-ab-device, default-device, default-partition, available-partitions, slot-suffix); renamed SupportedKmi to SupportedKmis |
| userspace/ksud/src/boot_patch.rs | Added partition parameter throughout patch flow; implemented new public functions for boot device/partition selection and slot suffix handling; refactored logic into reusable functions |
| manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt | Converted isAbDevice to suspend function using new CLI; added new suspend functions for partition/device queries; removed unused imports |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Install.kt | Added partition selection dropdown with animated visibility; replaced isInitBoot() with getDefaultPartitionName(); converted isAbDevice to suspend call |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Flash.kt | Added partition parameter to FlashBoot data class and installBoot call |
| manager/app/src/main/res/values/strings.xml | Added install_select_partition string resource |
| manager/app/src/main/res/values-zh-rCN/strings.xml | Added Chinese translation for install_select_partition; simplified install_inactive_slot_warning text |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt | Reordered import for DropdownImpl |
| manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt | Removed unused import |
Comments suppressed due to low confidence (1)
userspace/ksud/src/boot_patch.rs:689
- The slot suffix calculation logic is duplicated from the
get_slot_suffixfunction (lines 777-787). Consider refactoringfind_boot_imageto callget_slot_suffix(ota)instead of duplicating this logic.
let mut slot_suffix =
utils::getprop("ro.boot.slot_suffix").unwrap_or_else(|| String::from(""));
if !slot_suffix.is_empty() && ota {
if slot_suffix == "_a" {
slot_suffix = "_b".to_string()
} else {
slot_suffix = "_a".to_string()
}
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* close tiann#2865 Co-authored-by: YuKongA <[email protected]> Signed-off-by: u9521 <[email protected]>
* close tiann#2865 Co-authored-by: YuKongA <[email protected]> Signed-off-by: u9521 <[email protected]>
* close tiann#2865 Co-authored-by: YuKongA <[email protected]> Signed-off-by: u9521 <[email protected]>