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 Jun 5, 2024
1 parent 64560ce commit 573575e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 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 TEMP_DIR_LEGACY: &str = "/sbin";

pub const MODULE_WEB_DIR: &str = "webroot";
Expand Down
31 changes: 0 additions & 31 deletions userspace/ksud/src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,33 +155,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());
if let Result::Ok(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,
)?;
} else {
mount(
KSU_OVERLAY_SOURCE,
dest.as_ref(),
"tmpfs",
MountFlags::empty(),
"",
)?;
}
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 @@ -320,8 +294,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 573575e

Please sign in to comment.