ksud: Only start the monitor and load the module when KPM is enabled

Co-authored-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
Co-authored-by: mihoy3rd <159522651+mihoy3rd@users.noreply.github.com>
This commit is contained in:
ShirkNeko
2025-09-10 14:56:23 +08:00
parent d83fc2aec6
commit 3ed1d9aebc
2 changed files with 55 additions and 88 deletions

View File

@@ -10,8 +10,6 @@ use std::path::Path;
pub fn on_post_data_fs() -> Result<()> {
ksucalls::report_post_fs_data();
kpm::start_kpm_watcher()?;
utils::umask(0);
#[cfg(unix)]
@@ -105,10 +103,12 @@ pub fn on_post_data_fs() -> Result<()> {
info!("no mount requested");
}
run_stage("post-mount", true);
if kpm::is_kpm_enabled()? {
kpm::start_kpm_watcher()?;
kpm::load_kpm_modules()?;
}
// load kpm modules
kpm::load_kpm_modules()?;
run_stage("post-mount", true);
Ok(())
}