ksud: don't mount module when in safe mode
This commit is contained in:
@@ -132,25 +132,26 @@ pub fn on_post_data_fs() -> Result<()> {
|
|||||||
warn!("load sepolicy.rule failed");
|
warn!("load sepolicy.rule failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if crate::utils::is_safe_mode() {
|
||||||
|
warn!("safe mode, skip module post-fs-data scripts");
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
// mount systemless overlay
|
// mount systemless overlay
|
||||||
if let Err(e) = mount_systemlessly(module_dir) {
|
if let Err(e) = mount_systemlessly(module_dir) {
|
||||||
warn!("do systemless mount failed: {}", e);
|
warn!("do systemless mount failed: {}", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// module mounted, exec modules post-fs-data scripts
|
// module mounted, exec modules post-fs-data scripts
|
||||||
if crate::utils::is_safe_mode() {
|
// todo: Add timeout
|
||||||
warn!("safe mode, skip module post-fs-data scripts");
|
if let Err(e) = crate::module::exec_common_scripts("post-fs-data.d", true) {
|
||||||
} else {
|
warn!("exec common post-fs-data scripts failed: {}", e);
|
||||||
// todo: Add timeout
|
}
|
||||||
if let Err(e) = crate::module::exec_common_scripts("post-fs-data.d", true) {
|
if let Err(e) = crate::module::exec_post_fs_data() {
|
||||||
warn!("exec common post-fs-data scripts failed: {}", e);
|
warn!("exec post-fs-data scripts failed: {}", e);
|
||||||
}
|
}
|
||||||
if let Err(e) = crate::module::exec_post_fs_data() {
|
if let Err(e) = crate::module::load_system_prop() {
|
||||||
warn!("exec post-fs-data scripts failed: {}", e);
|
warn!("load system.prop failed: {}", e);
|
||||||
}
|
|
||||||
if let Err(e) = crate::module::load_system_prop() {
|
|
||||||
warn!("load system.prop failed: {}", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user