pub(crate) async fn write_composefs_state(
root_path: &Utf8PathBuf,
deployment_id: &Sha512HashValue,
target_imgref: &ImageReference,
initialize_var: bool,
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 deploymentinitialize_var- Whether to populate the shared/varfrom the imageboot_type- Boot artifact type (Bls,Uki, orAboot)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