The root package becomes a virtual workspace: `crates/ecr` holds the library (package name `ecr`) and `crates/ecr-cli` the command line front-end, which keeps installing the `ecr` binary. No behavior change. The library must not depend on CLI types, so mount::setup_mounts now takes the `no_bind` flag instead of a `&Args`.
31 lines
827 B
Rust
31 lines
827 B
Rust
//! ecr — ephemeral chroot environments with Linux namespaces.
|
|
//!
|
|
//! This crate is the library behind the `ecr` CLI. It resolves distro and
|
|
//! OCI image references, downloads them through a content cache, extracts
|
|
//! the rootfs into a scratch directory, and runs commands inside
|
|
//! unprivileged user/PID/mount/UTS namespaces — or boots it in a QEMU VM
|
|
//! (see the `qemu_vm` module).
|
|
|
|
pub mod chroot;
|
|
pub mod config;
|
|
pub mod distro;
|
|
pub mod download;
|
|
pub mod extract;
|
|
pub mod kernel;
|
|
pub mod mount;
|
|
pub mod namespace;
|
|
pub mod qemu;
|
|
pub mod qemu_vm;
|
|
pub mod utils;
|
|
pub mod verbose;
|
|
|
|
/// Print to stderr only when verbose mode is active (see [`verbose::set`]).
|
|
#[macro_export]
|
|
macro_rules! veprintln {
|
|
($($arg:tt)*) => {
|
|
if $crate::verbose::is_verbose() {
|
|
eprintln!($($arg)*);
|
|
}
|
|
};
|
|
}
|