pub(crate) async fn write_composefs_state(
root_path: &Utf8PathBuf,
deployment_id: &Sha512HashValue,
target_imgref: &ImageReference,
staged: Option<StagedDeployment>,
boot_type: BootType,
boot_digest: String,
manifest_digest: &str,
allow_missing_fsverity: bool,
) -> Result<()>Expand description
Creates and populates the composefs state directory for a deployment.
This function sets up the state directory structure and configuration files
needed for a composefs deployment. It creates the deployment state directory,
copies configuration, sets up the shared /var directory, and writes metadata
files including the origin configuration and image information.
§Arguments
root_path- The root filesystem path (typically/sysroot)deployment_id- Unique SHA512 hash identifier for this deploymentimgref- Container image reference for the deploymentstaged- Whether this is a staged deployment (writes to transient state dir)boot_type- Boot loader type (BlsorUki)boot_digest- Optional boot digest for verificationmanifest_digest- OCI manifest content digest, stored in the origin file so the manifest+config can be retrieved from the composefs repo later
§State Directory Structure
Creates the following structure under /sysroot/state/deploy/{deployment_id}/:
etc/- Copy of system configuration filesvar- Symlink to shared/vardirectory{deployment_id}.origin- Origin configuration with image ref, boot, and image metadata
For staged deployments, also writes to /run/composefs/staged-deployment.