Skip to content

Commit cc388ce

Browse files
committed
ksud: fix compilation and remove unused imports
Signed-off-by: Faris <[email protected]>
1 parent 8fc82c3 commit cc388ce

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

userspace/ksud/src/defs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@ pub const KSU_BACKUP_DIR: &str = WORKING_DIR;
4141
pub const KSU_BACKUP_FILE_PREFIX: &str = "ksu_backup_";
4242
pub const BACKUP_FILENAME: &str = "stock_image.sha1";
4343

44-
pub const NO_TMPFS_PATH: &str = concatcp!(WORKING_DIR, ".notmpfs");
4544
pub const NO_MOUNT_PATH: &str = concatcp!(WORKING_DIR, ".nomount");
4645
pub const GLOBAL_NAMESPACE_FILE: &str = concatcp!(WORKING_DIR, ".global_mnt");

userspace/ksud/src/init_event.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
use crate::defs::{KSU_MOUNT_SOURCE, NO_MOUNT_PATH, NO_TMPFS_PATH};
1+
use crate::defs::NO_MOUNT_PATH;
22
use crate::module::{handle_updated_modules, prune_modules};
33
use crate::utils::find_tmp_path;
44
use crate::{assets, defs, ksucalls, restorecon, utils};
55
use anyhow::{Context, Result};
66
use log::{info, warn};
7-
use rustix::fs::{MountFlags, mount};
87
use std::path::Path;
98

9+
#[cfg(target_os = "android")]
10+
pub fn mount_modules_systemlessly() -> Result<()> {
11+
crate::magic_mount::magic_mount(&find_tmp_path())
12+
}
13+
14+
#[cfg(not(target_os = "android"))]
15+
pub fn mount_modules_systemlessly() -> Result<()> {
16+
Ok(())
17+
}
18+
1019
pub fn on_post_data_fs() -> Result<()> {
1120
ksucalls::report_post_fs_data();
1221

0 commit comments

Comments
 (0)