Mount temp dir at /debug_ramdisk (#1226)
This commit is contained in:
@@ -161,6 +161,16 @@ fn mount_overlayfs(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[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());
|
||||
Mount::builder()
|
||||
.fstype(FilesystemType::from("tmpfs"))
|
||||
.mount(KSU_OVERLAY_SOURCE, dest.as_ref())
|
||||
.with_context(|| format!("mount tmpfs on {} failed", dest.as_ref().display()))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
fn bind_mount(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()> {
|
||||
info!(
|
||||
@@ -276,3 +286,8 @@ pub fn umount_dir(_src: &str) -> Result<()> {
|
||||
pub fn mount_overlay(_dest: &String, _lower_dirs: &Vec<String>) -> Result<()> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "linux", target_os = "android")))]
|
||||
pub fn mount_tmpfs(_dest: impl AsRef<Path>) -> Result<()> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user