Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 202 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
tracing-journald = "0.3.1"
uzers = "0.12"
xshell = "0.2.6"
zlink = "0.4"

# See https://github.com/coreos/cargo-vendor-filterer
[workspace.metadata.vendor-filter]
Expand Down Expand Up @@ -98,7 +99,9 @@ bins = ["skopeo", "podman", "ostree", "zstd", "setpriv", "systemctl", "chcon"]
# Require an extra opt-in for unsafe
unsafe_code = "deny"
# Absolutely must handle errors
unused_must_use = "forbid"
# "deny" rather than "forbid" so that proc-macro expansions (e.g. zlink)
# can locally #[allow(unused)] without conflicting.
unused_must_use = "deny"
missing_docs = "deny"
missing_debug_implementations = "deny"
# Feel free to comment this one out locally during development of a patch.
Expand Down
1 change: 1 addition & 0 deletions crates/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ tar = "0.4.43"
tini = "1.3.0"
uuid = { version = "1.8.0", features = ["v4"] }
uapi-version = "0.4.0"
zlink = { workspace = true }

[dev-dependencies]
similar-asserts = { workspace = true }
Expand Down
15 changes: 14 additions & 1 deletion crates/lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ pub(crate) struct StatusOpts {
/// Include additional fields in human readable format.
#[clap(long, short = 'v')]
pub(crate) verbose: bool,

/// Query a sysroot at an arbitrary path instead of the booted system.
///
/// Useful for inspecting a freshly installed (not yet booted) system,
/// e.g. `bootc status --json --sysroot /mnt`.
#[clap(long)]
pub(crate) sysroot: Option<camino::Utf8PathBuf>,
}

/// Add a transient overlayfs on /usr
Expand Down Expand Up @@ -1598,6 +1605,11 @@ where
I: IntoIterator,
I::Item: Into<OsString> + Clone,
{
// If we were socket-activated (e.g. via `varlinkctl exec:`), serve
// varlink and exit without parsing CLI arguments.
if crate::varlink::try_serve_varlink().await? {
return Ok(());
}
run_from_opt(Opt::parse_including_static(args)).await
}

Expand Down Expand Up @@ -2228,7 +2240,8 @@ mod tests {
format: None,
format_version: None,
booted: false,
verbose: false
verbose: false,
sysroot: None,
})
));
assert!(matches!(
Expand Down
2 changes: 1 addition & 1 deletion crates/lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ pub(crate) struct InstallConfigOpts {
/// is to allow mounting the whole `/root` home directory as a `tmpfs`, while still
/// getting the SSH key replaced on boot.
#[clap(long)]
root_ssh_authorized_keys: Option<Utf8PathBuf>,
pub(crate) root_ssh_authorized_keys: Option<Utf8PathBuf>,

/// Perform configuration changes suitable for a "generic" disk image.
/// At the moment:
Expand Down
1 change: 1 addition & 0 deletions crates/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ mod store;
mod task;
mod ukify;
mod utils;
pub(crate) mod varlink;

#[cfg(feature = "docgen")]
mod cli_json;
Expand Down
Loading