MCPcopy Create free account
hub / github.com/bootc-dev/bootc / get_storage

Function get_storage

crates/lib/src/cli.rs:994–1003  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

992/// This prepares the process for write operations (re-exec, mount namespace, etc).
993#[context("Initializing storage")]
994pub(crate) async fn get_storage() -> Result<crate::store::BootedStorage> {
995 let env = crate::store::Environment::detect()?;
996 // Always call prepare_for_write() for write operations - it checks
997 // for container, root privileges, mount namespace setup, etc.
998 prepare_for_write()?;
999 let r = BootedStorage::new(env)
1000 .await?
1001 .ok_or_else(|| anyhow!("System not booted via bootc"))?;
1002 Ok(r)
1003}
1004
1005#[context("Querying root privilege")]
1006pub(crate) fn require_root(is_container: bool) -> Result<()> {

Callers 8

install_resetFunction · 0.85
list_imagesFunction · 0.85
set_unified_entrypointFunction · 0.85
publish_factsFunction · 0.85
switchFunction · 0.85
rollbackFunction · 0.85
editFunction · 0.85
run_from_optFunction · 0.85

Calls 1

prepare_for_writeFunction · 0.85

Tested by

no test coverage detected