summaryrefslogtreecommitdiffstats
path: root/src/runner
diff options
context:
space:
mode:
Diffstat (limited to 'src/runner')
-rw-r--r--src/runner/runc/run.rs8
-rw-r--r--src/runner/runc/spec.rs9
2 files changed, 16 insertions, 1 deletions
diff --git a/src/runner/runc/run.rs b/src/runner/runc/run.rs
index e5e48cf..f4de980 100644
--- a/src/runner/runc/run.rs
+++ b/src/runner/runc/run.rs
@@ -57,10 +57,16 @@ fn init_task() -> Result<(), Error> {
)
.to_io_result()?;
+ let mut dir = fs::DirBuilder::new();
+ dir.recursive(true);
+
let workdir = "build/tmp/runc/workdir";
- fs::DirBuilder::new().create(workdir)?;
+ dir.create(workdir)?;
unistd::chown(workdir, Some(unshare::BUILD_UID), Some(unshare::BUILD_GID)).to_io_result()?;
+ let sysroot = "build/tmp/runc/depends/opt/sysroot";
+ dir.create(sysroot)?;
+
Ok(())
}
diff --git a/src/runner/runc/spec.rs b/src/runner/runc/spec.rs
index 5cfdfa2..75f8963 100644
--- a/src/runner/runc/spec.rs
+++ b/src/runner/runc/spec.rs
@@ -40,6 +40,15 @@ pub fn generate_spec(run: &str, env: &HashMap<String, String>) -> runtime::Spec
]
},
{
+ "destination": "/opt/sysroot",
+ "type": "none",
+ "source": "depends/opt/sysroot",
+ "options": [
+ "bind",
+ "ro"
+ ]
+ },
+ {
"destination": "/proc",
"type": "proc",
"source": "proc"