diff --git a/userspace/ksud/src/defs.rs b/userspace/ksud/src/defs.rs index 8033ee26..a8b8e100 100644 --- a/userspace/ksud/src/defs.rs +++ b/userspace/ksud/src/defs.rs @@ -38,5 +38,4 @@ pub const KSU_BACKUP_DIR: &str = WORKING_DIR; pub const KSU_BACKUP_FILE_PREFIX: &str = "ksu_backup_"; 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"); diff --git a/userspace/ksud/src/init_event.rs b/userspace/ksud/src/init_event.rs index dc551152..c2552b7c 100644 --- a/userspace/ksud/src/init_event.rs +++ b/userspace/ksud/src/init_event.rs @@ -2,17 +2,26 @@ use crate::kpm; use crate::{ assets, defs, - defs::{KSU_MOUNT_SOURCE, NO_MOUNT_PATH, NO_TMPFS_PATH}, + defs::{NO_MOUNT_PATH}, + utils::find_tmp_path, ksucalls, module::{handle_updated_modules, prune_modules}, restorecon, uid_scanner, utils, }; -use crate::utils::find_tmp_path; use anyhow::{Context, Result}; use log::{info, warn}; -use rustix::fs::{MountFlags, mount}; use std::path::Path; +#[cfg(target_os = "android")] +pub fn mount_modules_systemlessly() -> Result<()> { + crate::magic_mount::magic_mount(&find_tmp_path()) +} + +#[cfg(not(target_os = "android"))] +pub fn mount_modules_systemlessly() -> Result<()> { + Ok(()) +} + pub fn on_post_data_fs() -> Result<()> { ksucalls::report_post_fs_data();