Skip to main content

Crate composefs

Crate composefs 

Source
Expand description

§composefs: The reliability of disk images, the flexibility of files

composefs combines several Linux kernel features to provide read-only mountable filesystem trees that stack on top of a conventional “lower” filesystem.

§Interfaces

composefs offers two programmatic interfaces:

  • Rust API — this crate and its siblings (composefs-oci, composefs-boot, etc.), usable as regular Cargo dependencies.
  • Varlink API — a varlink RPC interface exposed by cfsctl varlink over a Unix socket, accessible from any language. See the varlink module for examples.

Neither interface is declared stable yet. Both may change across releases while the project is under active development.

§Key technologies

  • overlayfs — the kernel mount interface that exposes the composed tree
  • EROFS — an in-kernel read-only filesystem for the metadata tree (directories, symlinks, permissions, xattrs) with no file data
  • fs-verity (optional) — per-file integrity verification on the backing store, validated by overlayfs at access time

§Design

composefs produces an EROFS image containing only metadata. Non-empty data files live in a content-addressed backing store, with trusted.overlay.redirect xattrs telling overlayfs where to find them. Identical files across images are stored once on disk and shared in the Linux page cache.

See the repository_format module for the on-disk layout.

Re-exports§

pub use repository::ImageNotFound;

Modules§

digest
Cryptographic hash digest wrappers backed by OpenSSL.
dumpfile
Reading and writing composefs dumpfile format.
dumpfile_parse
Parsing and generating composefs dump file entry
erofs
EROFS (Enhanced Read-Only File System) format support for composefs.
erofs_format
composefs EROFS image format
filesystem_ops
High-level filesystem operations for composefs trees.
fs
Reading and writing filesystem trees to/from disk.
fsverity
Linux fs-verity support for integrity verification.
generic_tree
A generic metadata-only filesystem tree where regular files can be stored however the caller wants.
mount
Modern Linux mount API support for composefs.
mountcompat
Compatibility helpers for older Linux kernel mount APIs.
progress
Progress reporting API for pull and download operations.
repository
Content-addressable repository for composefs objects.
repository_format
composefs repository design
splitstream
Split Stream file format implementation.
splitstream_format
Splitstream
tree
A filesystem tree which stores regular files using the composefs strategy of inlining small files, and having an external fsverity reference for larger ones.
util
Utility functions and types used throughout the composefs crate.
varlink
Varlink API

Constants§

INLINE_CONTENT_MAX_V0
Files with this many bytes or fewer are stored inline in the erofs image (and in splitstreams). Files above this threshold are written to object storage and referenced via overlay metacopy xattrs.
MAX_INLINE_CONTENT
Maximum inline content size accepted when parsing untrusted input (dumpfiles, EROFS images in composefs-restricted mode).
SYMLINK_MAX
Maximum symlink target length in bytes.