ksud: added module mount command to check current mount system enabled

This commit is contained in:
rifsxd
2025-04-02 15:12:44 +06:00
parent c5aa6ffffc
commit 02dbb7d0f7
6 changed files with 27 additions and 0 deletions

View File

@@ -228,6 +228,9 @@ enum Module {
id: String,
},
/// current mount system
Mount,
/// list all modules
List,
}
@@ -313,6 +316,7 @@ pub fn run() -> Result<()> {
Module::Enable { id } => module::enable_module(&id),
Module::Disable { id } => module::disable_module(&id),
Module::Action { id } => module::run_action(&id),
Module::Mount => module::mount_system(),
Module::List => module::list_modules(),
}
}

View File

@@ -42,3 +42,5 @@ pub const BACKUP_FILENAME: &str = "stock_image.sha1";
pub const NO_TMPFS_PATH: &str = concatcp!(WORKING_DIR, ".notmpfs");
pub const NO_MOUNT_PATH: &str = concatcp!(WORKING_DIR, ".nomount");
pub const MOUNT_SYSTEM: &str = "Magic_Mount";

View File

@@ -493,6 +493,12 @@ fn _list_modules(path: &str) -> Vec<HashMap<String, String>> {
modules
}
pub fn mount_system() -> Result<()> {
println!("Current mount system: {}", defs::MOUNT_SYSTEM);
Ok(())
}
pub fn list_modules() -> Result<()> {
let modules = _list_modules(defs::MODULE_DIR);
println!("{}", serde_json::to_string_pretty(&modules)?);