()
| 992 | /// This prepares the process for write operations (re-exec, mount namespace, etc). |
| 993 | #[context("Initializing storage")] |
| 994 | pub(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")] |
| 1006 | pub(crate) fn require_root(is_container: bool) -> Result<()> { |
no test coverage detected