summaryrefslogtreecommitdiffstats
path: root/src/runner
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2021-07-17 19:37:31 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2021-07-17 20:22:38 +0200
commit016835293b77dbfcd578ba41e735fb6b777331d5 (patch)
tree7984bc6218df38bfa12cb6c4f05d683b7f142995 /src/runner
parent021b7d06acc6b54e9da4719f8e98970b0548b583 (diff)
downloadrebel-016835293b77dbfcd578ba41e735fb6b777331d5.tar
rebel-016835293b77dbfcd578ba41e735fb6b777331d5.zip
runc: mount sysroot to /opt/sysroot
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"