diff --git a/userspace/ksud/Cargo.toml b/userspace/ksud/Cargo.toml index c1fd4b64..e04f27b6 100644 --- a/userspace/ksud/Cargo.toml +++ b/userspace/ksud/Cargo.toml @@ -31,13 +31,13 @@ rust-embed = { version = "6.4.2", features = [ "debug-embed", "compression", # must clean build after updating binaries ] } -proc-mounts = "0.3" [target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies] sys-mount = { git = "https://github.com/tiann/sys-mount" } # some android specific dependencies which compiles under unix are also listed here for convenience of coding android-properties = { version = "0.2.2", features = ["bionic-deprecated"] } procfs = "0.15" +proc-mounts = "0.3" [target.'cfg(target_os = "android")'.dependencies] android_logger = "0.13" diff --git a/userspace/ksud/src/mount.rs b/userspace/ksud/src/mount.rs index d4d8c235..ca4c13e0 100644 --- a/userspace/ksud/src/mount.rs +++ b/userspace/ksud/src/mount.rs @@ -1,7 +1,7 @@ -use anyhow::Result; +use anyhow::{Ok, Result}; #[cfg(any(target_os = "linux", target_os = "android"))] -use anyhow::{Context, Ok}; +use anyhow::Context; #[cfg(any(target_os = "linux", target_os = "android"))] use retry::delay::NoDelay; #[cfg(any(target_os = "linux", target_os = "android"))] @@ -260,9 +260,11 @@ impl StockOverlay { #[derive(Debug)] pub struct StockMount { mnt: String, + #[cfg(any(target_os = "linux", target_os = "android"))] mountlist: proc_mounts::MountList, } +#[cfg(any(target_os = "linux", target_os = "android"))] impl StockMount { pub fn new(mnt: &str) -> Result { let mountlist = proc_mounts::MountList::new()?; @@ -322,3 +324,20 @@ impl StockMount { Ok(()) } } + +#[cfg(not(any(target_os = "linux", target_os = "android")))] +impl StockMount { + pub fn new(mnt: &str) -> Result { + Ok(Self { + mnt: mnt.to_string(), + }) + } + + pub fn umount(&self) -> Result<()> { + unimplemented!() + } + + pub fn remount(&self) -> Result<()> { + unimplemented!() + } +}