diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2021-11-01 23:20:49 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2021-11-01 23:33:45 +0100 |
commit | 3123a16b6793a209aa10b4e72b63729ae9a32e99 (patch) | |
tree | c22afe45db2e2091fb19e723a046a3fe2ee3c024 /crates/runner/src/init.rs | |
parent | f6e4529dba0adbf1736687686a0d70e674830a21 (diff) | |
download | rebel-3123a16b6793a209aa10b4e72b63729ae9a32e99.tar rebel-3123a16b6793a209aa10b4e72b63729ae9a32e99.zip |
runner: use rootfs passed in Task definition
With this, the rootfs hash is included in the task's input hash, so now
the hash covers all significant inputs except for the runner itself.
Diffstat (limited to 'crates/runner/src/init.rs')
-rw-r--r-- | crates/runner/src/init.rs | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/crates/runner/src/init.rs b/crates/runner/src/init.rs index ad37cf0..ede8fd8 100644 --- a/crates/runner/src/init.rs +++ b/crates/runner/src/init.rs @@ -1,29 +1,8 @@ -use std::fs::File; - use nix::mount::{self, MsFlags}; use common::error::*; -use super::{tar, util::fs}; -use crate::paths; - -fn prepare_rootfs(path: &str) -> Result<()> { - tar::unpack(File::open(paths::ROOTFS_ARCHIVE)?, path) - .context("Unpacking build container rootfs failed")?; - - mount::mount::<_, _, str, str>(Some(path), path, None, MsFlags::MS_BIND, None) - .context("Failed to bind mount container rootfs")?; - mount::mount::<str, _, str, str>( - None, - path, - None, - MsFlags::MS_REMOUNT | MsFlags::MS_BIND | MsFlags::MS_RDONLY, - None, - ) - .context("Failed to mount container rootfs read-only")?; - - Ok(()) -} +use crate::{paths, util::fs}; fn prepare_dev(path: &str) -> Result<()> { fs::mkdir(path)?; @@ -83,7 +62,6 @@ pub fn init_runner() -> Result<()> { mount::mount::<str, _, str, str>(None, paths::TMP_DIR, None, MsFlags::MS_PRIVATE, None) .context("Failed to set MS_PRIVATE for build tmpdir")?; - prepare_rootfs(paths::ROOTFS_DIR)?; prepare_dev(paths::DEV_DIR)?; Ok(()) |