Skip to content

Commit

Permalink
Merge pull request containers#393 from cgwalters/install-log-container
Browse files Browse the repository at this point in the history
install: Improve early output
  • Loading branch information
cgwalters authored Mar 14, 2024
2 parents b809bcf + 3ee4e0e commit ac17000
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
20 changes: 10 additions & 10 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,11 +849,10 @@ pub(crate) fn setup_tmp_mounts() -> Result<()> {
} else {
// Note we explicitly also don't want a "nosuid" tmp, because that
// suppresses our install_t transition
Task::new_and_run(
"Mounting tmpfs /tmp",
"mount",
["tmpfs", "-t", "tmpfs", "/tmp"],
)?;
Task::new("Mounting tmpfs /tmp", "mount")
.args(["tmpfs", "-t", "tmpfs", "/tmp"])
.quiet()
.run()?;
}

// Point our /var/tmp at the host, via the /proc/1/root magic link
Expand Down Expand Up @@ -918,11 +917,10 @@ pub(crate) fn setup_sys_mount(fstype: &str, fspath: &str) -> Result<()> {
}

// This means the host has this mounted, so we should mount it too
Task::new_and_run(
format!("Mounting {fstype} {fspath}"),
"mount",
["-t", fstype, fstype, fspath],
)
Task::new(format!("Mounting {fstype} {fspath}"), "mount")
.args(["-t", fstype, fstype, fspath])
.quiet()
.run()
}

/// Verify that we can load the manifest of the target image
Expand Down Expand Up @@ -1026,6 +1024,8 @@ async fn prepare_install(
let (override_disable_selinux, setenforce_guard) =
reexecute_self_for_selinux_if_needed(&source, config_opts.disable_selinux)?;

println!("Installing: {:#}", &target_imgref);

let install_config = config::load_config()?;
tracing::debug!("Loaded install configuration");

Expand Down
9 changes: 4 additions & 5 deletions lib/src/install/baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,10 @@ pub(crate) fn install_create_rootfs(
}
let devdir = mntdir.join("dev");
std::fs::create_dir_all(&devdir)?;
Task::new_and_run(
"Mounting devtmpfs",
"mount",
["devtmpfs", "-t", "devtmpfs", devdir.as_str()],
)?;
Task::new("Mounting devtmpfs", "mount")
.args(["devtmpfs", "-t", "devtmpfs", devdir.as_str()])
.quiet()
.run()?;

// Now at this point, our /dev is a stale snapshot because we don't have udev running.
// So from hereon after, we prefix devices with our temporary devtmpfs mount.
Expand Down

0 comments on commit ac17000

Please sign in to comment.