ksud: respect the skip_mount flag of module

This commit is contained in:
weishu
2023-06-22 17:00:02 +08:00
parent c3c990c50a
commit c7c9e9c3ed
2 changed files with 6 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ pub const MODULE_UPDATE_TMP_DIR: &str = concatcp!(ADB_DIR, "modules_update/");
pub const DISABLE_FILE_NAME: &str = "disable"; pub const DISABLE_FILE_NAME: &str = "disable";
pub const UPDATE_FILE_NAME: &str = "update"; pub const UPDATE_FILE_NAME: &str = "update";
pub const REMOVE_FILE_NAME: &str = "remove"; pub const REMOVE_FILE_NAME: &str = "remove";
pub const SKIP_MOUNT_FILE_NAME: &str = "skip_mount";
pub const VERSION_CODE: &str = include_str!(concat!(env!("OUT_DIR"), "/VERSION_CODE")); pub const VERSION_CODE: &str = include_str!(concat!(env!("OUT_DIR"), "/VERSION_CODE"));
pub const VERSION_NAME: &str = include_str!(concat!(env!("OUT_DIR"), "/VERSION_NAME")); pub const VERSION_NAME: &str = include_str!(concat!(env!("OUT_DIR"), "/VERSION_NAME"));

View File

@@ -50,6 +50,11 @@ pub fn mount_systemlessly(module_dir: &str) -> Result<()> {
info!("module: {} is disabled, ignore!", module.display()); info!("module: {} is disabled, ignore!", module.display());
continue; continue;
} }
let skip_mount = module.join(defs::SKIP_MOUNT_FILE_NAME).exists();
if skip_mount {
info!("module: {} skip_mount exist, skip!", module.display());
continue;
}
let module_system = Path::new(&module).join("system"); let module_system = Path::new(&module).join("system");
if module_system.is_dir() { if module_system.is_dir() {