Skip to content

Commit

Permalink
Revert "Mount temp dir at /debug_ramdisk (tiann#1226)"
Browse files Browse the repository at this point in the history
This reverts commit 706cd1e.

Signed-off-by: xiangfeidexiaohuo <[email protected]>
  • Loading branch information
xiangfeidexiaohuo committed Aug 23, 2024
1 parent 77db840 commit 93c8c0a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
1 change: 0 additions & 1 deletion kernel/core_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
try_umount("/data/adb/modules", false, MNT_DETACH);

// try umount ksu temp path
try_umount("/debug_ramdisk", false, MNT_DETACH);
try_umount("/sbin", false, MNT_DETACH);

return 0;
Expand Down
1 change: 0 additions & 1 deletion userspace/ksud/src/defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pub const MODULE_UPDATE_TMP_DIR: &str = concatcp!(ADB_DIR, "modules_update/");

pub const SYSTEM_RW_DIR: &str = concatcp!(MODULE_DIR, ".rw/");

pub const TEMP_DIR: &str = "/debug_ramdisk";
pub const MODULE_WEB_DIR: &str = "webroot";
pub const DISABLE_FILE_NAME: &str = "disable";
pub const UPDATE_FILE_NAME: &str = "update";
Expand Down
22 changes: 0 additions & 22 deletions userspace/ksud/src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,24 +152,7 @@ pub fn mount_overlayfs(
}

#[cfg(any(target_os = "linux", target_os = "android"))]
pub fn mount_tmpfs(dest: impl AsRef<Path>) -> Result<()> {
info!("mount tmpfs on {}", dest.as_ref().display());
let fs = fsopen("tmpfs", FsOpenFlags::FSOPEN_CLOEXEC)?;
let fs = fs.as_fd();
fsconfig_set_string(fs, "source", KSU_OVERLAY_SOURCE)?;
fsconfig_create(fs)?;
let mount = fsmount(fs, FsMountFlags::FSMOUNT_CLOEXEC, MountAttrFlags::empty())?;
move_mount(
mount.as_fd(),
"",
CWD,
dest.as_ref(),
MoveMountFlags::MOVE_MOUNT_F_EMPTY_PATH,
)?;
Ok(())
}

#[cfg(any(target_os = "linux", target_os = "android"))]
pub fn bind_mount(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()> {
info!(
"bind mount {} -> {}",
Expand Down Expand Up @@ -299,8 +282,3 @@ pub fn mount_overlay(
) -> Result<()> {
unimplemented!()
}

#[cfg(not(any(target_os = "linux", target_os = "android")))]
pub fn mount_tmpfs(_dest: impl AsRef<Path>) -> Result<()> {
unimplemented!()
}

0 comments on commit 93c8c0a

Please sign in to comment.