Merge "Make compsvc works in VM"
diff --git a/compos/src/compsvc.rs b/compos/src/compsvc.rs
index 16c3510..4ad2e03 100644
--- a/compos/src/compsvc.rs
+++ b/compos/src/compsvc.rs
@@ -48,7 +48,7 @@
const WORKER_BIN: &str = "/apex/com.android.compos/bin/compsvc_worker";
// TODO: Replace with a valid directory setup in the VM.
-const AUTHFS_MOUNTPOINT: &str = "/data/local/tmp/authfs_mnt";
+const AUTHFS_MOUNTPOINT: &str = "/data/local/tmp";
struct CompService {
worker_bin: PathBuf,
diff --git a/compos/src/compsvc_worker.rs b/compos/src/compsvc_worker.rs
index cf40f81..0456d58 100644
--- a/compos/src/compsvc_worker.rs
+++ b/compos/src/compsvc_worker.rs
@@ -30,7 +30,7 @@
use std::thread::sleep;
use std::time::{Duration, Instant};
-const AUTHFS_BIN: &str = "/apex/com.android.virt/bin/authfs";
+const AUTHFS_BIN: &str = "/system/bin/authfs";
const AUTHFS_SETUP_POLL_INTERVAL_MS: Duration = Duration::from_millis(50);
const AUTHFS_SETUP_TIMEOUT_SEC: Duration = Duration::from_secs(10);
const FUSE_SUPER_MAGIC: FsType = FsType(0x65735546);
@@ -47,7 +47,11 @@
// TODO(b/185175567): Run in a more restricted sandbox.
let jail = Minijail::new()?;
- let mut args = vec![AUTHFS_BIN.to_string(), config.authfs_root.clone()];
+ let mut args = vec![
+ AUTHFS_BIN.to_string(),
+ config.authfs_root.clone(),
+ "--cid=2".to_string(), // Always use host unless we need to support other cases
+ ];
for conf in &config.in_fds {
// TODO(b/185178698): Many input files need to be signed and verified.
// or can we use debug cert for now, which is better than nothing?